-
-
Notifications
You must be signed in to change notification settings - Fork 77
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
Does not support 24-bit "truecolor" escape sequences. #101
Comments
Awesome! Thank you! |
I hate to be a nuisance, but I just learned the hard way that there are apparently two different ways of specifying 24-bit color codes: There's this way, which you added support for, where semicolon ( print('\x1b[38;2;0;128;0mhello\x1b[39m') But there's also this way, where they use colon ( print('\x1b[38:2:0:128:0mhello\x1b[39m') |
Hi @jaysonlarose can you make a new dedicated ticket for that please? This one is closed and fixed and a bug in it or new scheme deserves a new ticket. Also, it would be great to know which apps you have seen produce this scheme, which terminal you used that did display colors this way, and any online doc links on that format that you are already aware of. Thanks! |
@hartwork Sure thing. Definitely! I'll start that off now. |
The xterm spec is a good reference: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Functions-using-CSI--ordered-by-the-final-character_s
So according to that, colon is the standard, and semicolon a deviation by KDE Konsole. |
@trygveaa That answers a few questions for me. I spent entirely too much time digging through ITU T.416, which is the same thing as that ISO standard that the xterm folks reference. The good news for me is that they've got a real loose definition of the term "supported". That ITU document talks about all of this stuff like being able to use CMYK color schemes and specifying colorspace conversion tolerances that are just straight up nonexistent in the XTerm spec. I'd argue that "the version that's most widely adopted" is the standard, personally, but that doesn't really help my case of trying to get this fix to happen :) Which I'll be submitting a new bug report for Real Soon Now, considering I'm not stuck trying to explain all this color space crap! |
I added some more info about the standards in the new issue. Yes, they don't support all the parameters values like CMYK colors, but there's a difference between partially implementing a standard and incorrectly implementing a standard.
Well, yes, semicolons has apparently become the de facto standard, which I learned now was because xterm initially incorrectly read the standard in 1999 and used semicolons, before they fixed it in 2012. As noted in my other comment using semicolons breaks the ability to combine multiple SGR parameters in one escape sequence though, so which separator to use is more than just a technicality. Funny how a misinterpretation of a standard in 1999 can still cause problems today :P |
A good reference for these escape sequences can be found here: https://gist.github.com/XVilka/8346728
I took a quick glance at the
Ansi2HTMLConverter
, and it looks like the regex you're using to parse the escape sequences is robust enough to do the business, but I haven't gone any further than that.--Jays
The text was updated successfully, but these errors were encountered: