Add a New Comment Rich Markup
Jump to the original submission
For now I applied workaround. To properly detect screen would need to be migrated to terminfo, which probably isn't a bad idea, but requires some effort.
Regarding "xterm-direct", you might find its mention in this page helpful, since it explains why I chose to implement it as is: https://invisible-island.net/ncurses/ncurses-slang.html
ncurses 6.1 (like ncurses 6.0) can be compiled to match the feature-set of older releases. Packagers tend to match the older releases... You have to use the "-x" option of infocmp to see extended capabilities, e.g., infocmp -x xterm-direct |grep RGB "RGB" is documented in the manual page: https://invisible-island.net/ncurses/man/user_caps.5.html If compiled to suppress the 32-bit terminfo feature, tic/infocmp will use the signed 16-bit limit. I could digress a little about the slow rate of adoption, but proposed correcting the tparm call because that works for you now. The 256-color escapes have been available for quite a while. If you're using Debian (or Ubuntu), you probably omitted the ncurses-term package. As far as assuming that various features are supported: if the terminal developers don't document what their program does, you can't assume anything about it :-)
I guess this will simplify things a bit, but will probably require some more work than just that: - if (f != of && (f & 0x04000000) && hastruecolor) { - uint8_t _r, _g, _b; - - _r = (f & 0x00ff0000) >> 16; - _g = (f & 0x0000ff00) >> 8; - _b = (f & 0x000000ff); - - /* TODO - properly get escape code */ - tputs(tparm("\033[38;2;%d;%d;%dm", _r, _g, _b), 1, DoAddChar); + if (f != of && (f & 0x04000000) && D_CCO == 32767) { + AddCStr2(D_CAF, f & 0x00ffffff); Still 'infocmp xterm-direct|grep -i rgb' returns nothing, should I be checking colors# (D_CCO == 32767 check in code above) and pairs#, or am I misunderstaning something? $ infocmp -V ncurses 6.1.20180127 $ infocmp xterm-direct|grep -i rgb $ Also are there any considerations I should take in regards to 256 color escapes? They are absent in terminfo, but still work. Should I just keep supporting them and assume that all direct color terminals support them?
ncurses 6.1 supports direct color by allowing 32-bit numbers in terminal descriptions, and adds an extended capability RGB which tells if/how the color number maps to red/green/blue components. The RGB capability is only provided via the terminfo interface, of course. I made terminal descriptions for xterm, iTerm2, konsole, st and VTE (named "xterm-direct", etc), but did not make a screen.xterm-direct, etc., (I suppose that's doable). (the proper name for what we're talking about is "direct color" -- TrueColor never applied, except with some imagination).
Yes, I'm aware of the problem. Proposed fix seems to work ok in my tests. But as mentioned it would be better if we could just get escape code from parent terminal terminfo. There seemed to be some work in this area to expose this information, but I'm not sure how it ended. Is it possible nowadays to get true color escape code from terminfo?
See comments here: https://stackoverflow.com/questions/50826467/screen-truecolor-ubuntu-18-04-broke
(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)
Attach Files: Comment:
No files currently attached
Depends on the following items: None found
Items that depend on this one: None found
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Only logged-in users can vote.
Please enter the title of George Orwell's famous dystopian book (it's a date):
Copyright © 2024 Free Software Foundation, Inc. Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved. The Levitating, Meditating, Flute-playing Gnu logo is a GNU GPL'ed image provided by the Nevrax Design Team. Page source code
Powered by Savane 3.13-3230.Corresponding source code