Closed tusharsnx closed 1 year ago
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 ;
vs :
, then ultimately it shouldn't matter, yea?
Unless there was a meaningful difference in implementation between 256/RGB colors being output with ; vs :, then ultimately it shouldn't matter, yea?
The final (on-screen) output remains same. But, I guess we should ensure that if the application had sent us (ConPTY) \e[38:2::r:g:b
, then we should forward the same. Currently, we don't have a way to indicate that the colors applied to the attr
is done using SubParams. vtrenderer will produce \e[38;2;r;g;b
in the output buffer.
I guess we should ensure that if the application had sent us (ConPTY)
\e[38:2::r:g:b
, then we should forward the same.
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 ;))
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.
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.
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?
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 38:1
(where 1
is "transparent" (???)) suggest that we might have a way to specify (on the Terminal side) a foreground color that you can see through to the background? Similar to the request in #7014?
does
38:1
(where1
is "transparent" (???)) suggest that we might have a way to specify (on the Terminal side) a foreground color that you can see through to the background?
I'm not sure, but I don't think so. My impression was that this was more or less the equivalent of SGR 8
(the "concealed" attribute), because that's the one SGR
attribute that isn't listed in the ODA docs.
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.
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 explanation[^1]:
[^1]: It is mostly cited from Wikipedia as it is short and clear.
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