-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Support ITU's T.416 - ODA colour sequences #15706
Comments
I'm not sure that we need to do the vtrenderer bits honestly, but everything else looks straightforward. Unless there was a meaningful difference in implementation between 256/RGB colors being output with |
The final (on-screen) output remains same. But, I guess we should ensure that if the application had sent us (ConPTY) |
Not all conpty clients will support the colon format, though, so it's best we always forward ODA colors using semicolons. If/when we do the extended underline attributes, though, those will have to use colons. |
Yeah, that works for me. We should accept as much as we can and begrudgingly emit the most compatible thing we can (which for better or for worse was a big accident that is more broadly-supported than the right thing ;)) |
That seems easy. I already have something locally that works. I might have concern regarding clients that feature test colon syntax by first sending the sequence and then querying ConPTY if the colour was applied. Wouldn't it confuse the client app if we send semi-colons instead of colons? Querying the terminal for colour support: https://github.com//termstandard/colors#querying-the-terminal On Windows Terminal (if were to return semi-colon): $ (echo -e '\e[48:2:1:2:3m\eP$qm\e\\' ; xxd)
^[P1$r0;48;2;2;3;0m^[\
00000000: 1b50 3124 7230 3b34 383b 323b 323b 333b .P1$r0;48;2;2;3; It might be less of a concern for us, if we've other ways to show that we also support colon format. |
That query is handled by conhost, and we definitely should be replying to that with colons once you've added the ODA support. So the app that's doing the feature testing will assume we support colons, and send us ODA colors using colons. But we should always pass that on to the conpty client with semicolons, since we have no idea what they support. It's theoretically possible they don't support ODA colors at all, in which case the feature testing isn't going to work correctly. But that's just an unfortunate limitation of conpty, and hopefully one day it could be resolved with the "passthrough" mode. |
This might be wishful thinking, but does |
I'm not sure, but I don't think so. My impression was that this was more or less the equivalent of And bear in mind that ODA is a document format - most of the functionality is geared towards printed output. Invisible text is easy enough to print (technically not print), but you're unlikely to be printing text that makes a hole in the paper so you can see through the background! It's probably worth checking to see what other terminals are doing with that option though. I think I might have looked into this in the past, but I can't find anything in my notes - possibly because nobody actually supported it. But I'll double check when I get a chance. |
This PR adds support for **ITU's T.416 - ODA SGR (38/48)** colour sequence, which makes use of colon instead of semi-colon as a parameter separator. - We use semi-colons as the only parameter separator while sending SGR color sequences to a ConPTY client. This is to keep backward compatibility. - In response to `DECRQSS` query, we have decided to use colons, as the major usecase for such queries are feature detection (whether client supports ODA colours), and tracking the original separator may add too much complexity to the codebase. ## Validation Steps Performed - Made sure that we are always sending semi-colon separated parameters regardless of whether the original sequence used colons. - Made sure that we are always using colons as the parameter separator in a `DECRQSS` response. - Added new tests! Closes #15706
Description
This is generally covered in #4321. But, since that will closed by #15648, we need a separate issue to track ITU T.416 - ODA Color sequence support.
Brief explanation1:
The ITU's T.416 Information technology - Open Document Architecture (ODA) and interchange format: Character content architectures uses ":" as separator characters instead:
Color 8-bit:
ESC[38:5:⟨n⟩m
ESC[48:5:⟨n⟩m
where n is the index from the xterm's color table
Color 24-bit:
This is a bit too extensive with CS tolerance. I've removed it for simplicity:
ESC[38:2::⟨r⟩:⟨g⟩:⟨b⟩m
ESC[48:2::⟨r⟩:⟨g⟩:⟨b⟩m
The two colons in the middle signifies ignored color-space-id, which is not supported in most cases. The ITU-RGB variation is supported by xterm, with the colorspace ID and tolerance parameters ignored. The parameters after the '2' (r, g, and b) are optional and can be left empty.
Per the ITU's T.416 - ODA documentation
Tasks
Footnotes
It is mostly cited from Wikipedia as it is short and clear. ↩
The text was updated successfully, but these errors were encountered: