-
Notifications
You must be signed in to change notification settings - Fork 8.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CSI 58 (undercurl color) sequence misbehaves when in "legacy ANSI" format #17426
Comments
@tusharsnx had some good rationale for only supporting the ITU T.418 format for underline colors - Tushar, do you remember what that was? |
Notes from #15795
To my understanding, we explicitly do not support or emit Zellij should probably do the same for the same reason. |
I remember blocking the sending of CSI-58 with If a console application sends us CSI-58 that's a strong signal that the intention is to color the underlines regardless of if it's followed by If we like to enable parsing of CSI-58 (like we do for CSI-38 and CSI-48), then there's a possibility, but only if it doesn't affect unsupported terminals. We will only emit CSI-58 with |
I like this solution because as @imsnif mentioned in the wezterm PR, zellij would like to stay uniform and backward-compatible in its implementation, and as a terminal multiplexer it probably shouldn't be its responsibility to handle diverging parser behaviors between platforms. |
For app devs (which includes zellij), I would recommend against using ITU sequences in any format unless you've somehow verified that the terminal actually supports those sequence. Both variants have the potential to break terminals that don't understand them. And if you use a That said, on our side I think it would be preferable if we supported both semicolons and colons for In an ideal world we should have first been testing the conpty client in the same way an app or multiplexer would, but if we have conpty passthrough soon that won't be necessary. |
I agree with this, since even if we enable "SGR 58 with semicolon" parsing, most terminals on Windows won't support that out-of-box (for like.. another few years). AFAIK, only Windows Terminal and WezTerm would get the support because they consume the most up-to-date Conpty implementation (from this repo), while others rely on inbox |
@tusharsnx - My reading of what @j4james wrote is that Zellij should interpret both colons and semicolons and only emit semicolons (which is what we do). And that Windows Terminal (apologies if I'm not using the right terminology, I do not know this ecosystem well) should interpret both semicolons and colons as well. Did I misread or misunderstand you @j4james ? |
No. I was saying Zellij should check the capabilities of the terminal before emitting anything. But if that is too much effort, then it should emit semicolons for 38 and 48, and colons for 58. |
Alright. I'm willing to issue the fix on our side. Namely as you said because terminals that support underline color necessarily support the colon format, but it would be nice if the fix would also be issued here (I guess Windows Terminal has more working hands and the issue really, as far as I know at least, doesn't happen anywhere else). |
@imsnif Just FYI, Mintty behaves the same way as Windows Terminal, i.e. SGR 38 ad 48 work with both colons and semicolons, but SGR 58 only works with colons. You can see the docs here: |
Thanks for the correction @j4james. My expectation expressed above still stands. |
Windows Terminal version
N/A
Windows build number
10.0.22631.0
Other Software
neovim 0.10.0
zellij 0.40.1
wezterm 20240520-135708-b8f94c47
Steps to reproduce
More details are described in wez/wezterm#5450
A short overview
In the wezterm issue mentioned above, I came across conpty handling the CS 58 (undercurl color) ANSI sequence in a way that causes visual bugs for
zellij
users on modern windows terminals.In short windows implementation seems to only accept the format:
ESC[58:2::234:105:98m
(colons, iterm-compatible)While if a proxy like
zellij
emits a more common ANSI form:ESC[58;2;234;105;98m
(semicolons)it leads to the terminal instead changing text background color.
Expected Behavior
I wanted to discuss a good way forward to fix this between the
zellij
project and the terminal implementations used on Windows. Some thoughts and options:zellij
behavior can be fixed instead.Actual Behavior
N/A
The text was updated successfully, but these errors were encountered: