Note that this was possible since years with most modern terminals, that support color changing. I've published an example C program that shows how one can use the initc terminfo capability to use user-supplied RGB values via ncurses. There's a seamingly infinite amount of developers and users on Stack Overflow and its forks that are desperate for a way to do this, with no existing solution if you go above 256 colors. That would help a lot for actually programatically determining the color capability of a terminal. If you're the maintainer/dev of a terminal emulator and reading this, please consider supporting DECRQSS. This solution would be really nice to have, because it doesn't look like terminfo/termcap will support truecolor within the next decade. It's a shame so many terminal emulators identify themselves as xterm, but don't actually support xterm. It's a basic VT100 escape sequence but seems to be unsupported by libvte, rxvt and Konsole. I actually found that in theory one could test the terminal via DECRQSS by sending DCS $ q m ST, but I could only get this to work in xterm and pangoterm (libvterm). So since terminfo doesn't seem to support true colors, is there any way to check a terminal for true color capability? I need to write a script that outputs either tc colors or just 256 colors, based on the capability of the current terminal. #Hidden cursor in zoc terminal codeI've implemented this mode also for netbsd-curses ( f824eed ), and i do indeed think that given the ability to select whatever color with RGB values, a restriction to 256 colors at the same time on the terminal makes sense in order to keep the code simple, and resource allocation reasonable. Ncurses supports this mode since ages, and i've written a wrapper library to use it in an easy way by just throwing RGB values at it instead of dealing with colorpairs. this is already possible since a long time with the "initc" terminfo capability, which looks like initc=\E]4 %p1%d rgb\:%p2%%/%2.2X\E\\, #Hidden cursor in zoc terminal fullWhen looking at the "true color" midnight commander themes, of which none is using more than a handful of colours, i get the impression what you guys want is really just the ability to freely pick colors with an RGB value from the full range of possible 24bit colous, instead of being restricted to a hardcoded palette - but it is not actually needed to have more than 256 colors in use at the same time in a terminal window. Anything else doesn't really matter to me as the end user. I believe most of people here think likewise. I'm perfectly fine with hardcoding terminal control sequences in my stupid script (which will never see light outside of my dotfiles) as well as with having to do. All I want is to see settings-independent RGB colors in my terminal, end of story. Ultimately, I'm afraid you mistake my role in this particular case: it's not the role of a developer, it's the role of a user. only if it gets recognized by the terminfo folk). Which is why Marc didn't want it, because Marc wants to do things the right way (i.e. To reword: applications (including ncurses, terminfo) do not universally support 24-bit so if people want to use it, they need to use something that might accidentally work in a certain program that decided to do things in its own way, and the program would need to come up with its own code sequences that might stay in conflict with other programs. That, and that it's not widely supported nor standardized, so that people wishing to use this feature would need to hardcode escape codes rather than asking terminal whether it supports this feature. You NEVER HARDCODE terminal control sequences into the application. Your ignorance goes so deep, you're actually saying the exact opposite. You're completely misrepresenting what Marc Lehmann has written. Sorry, something went I read your comment only now cause you've misspelled my handle. This means that from the user point of view you stick with ' ' as has suggested. This means that the ':' vs ' ' interpretations that XTerm and all the application that clone it or use it do things in slightly different ways and IMO the old sane thing an emulator can now do is to treat ':' and ' ' as aliases. (OTOH the character may terminate the sequence if the parser is a little substandard, which makes SGR with just colons problematic.) Usually an emulator will treat it like '?' or '=' and assume the entire sequence should be ignored, which is perfect in theory but breaks truecolour SGR. In the real world none of them do because ECMA-48 is notoriously unclear and "ITU T.416-199303" (the only 'standard' that uses this for it's colour sequences) was never publicly published. An ECMA-48 conforming parser is supposed to treat the ':' as another digit or a decimal point or something like that and if it doesn't understand the sequence it skips that bit. The original aim of the colon notation was to allow support for floating point number sequences.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |