Open farmboy-isa-dev opened 6 years ago
I thought about adding 256-color support several times in the past, and even adding 64k or 16M color support.
While certainly useful and not overly difficult, it requires extending the 'hwattr' type, that contains Unicode codepoint + fg color + bg color + pseudographics, from uint32_t to something larger as uint64_t or some custom struct.
It's not something I am very eager to do, for two reasons:
At the moment, I am more interested in making twin fully Unicode aware: several parts, including the three X11 hw drivers you worked on, are still limited to the first 64k codepoints
Would it be possible to add this as a compile option or would that make it harder to maintain?
Adding as a compile-time option the choice between current 16-color-palette support and truecolor (24-bits) would definitely complicate the code - and thus its maintenance. There are two reasons:
The latter means you may have a client (for example, twdisplay or twterm) compiled with the old 16-color-palette support communicating with a server compiled with truecolor (24-bits) support - or vice versa. Such interoperability would require adding runtime detection and conversion between color formats.
I rarely work in an environment w/o 256 color support and have gotten used to vim w/ more than 16 colors, so I'd be interested in adding support to emulate xterm-256color in twin. Any thoughts about how difficult this would be? Suggestions about where to focus in the twin code base?
FYI, a secondary reason for emulating xterm-256color is I like 'set cursorline' in vim - but with TERM=linux, instead of underlining it turns off syntax highlighting on the current line. The vim documentation mentions that this is due to limitation in some terminal types. I confirmed this appears to be due to TERM=linux (not a bug in twin) by reproducing the behavior in a linux virtual console.