-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
True Color support in both GUI and console application #59
Comments
@XVilka these concerns will go in other projects. neovim will simply emit color information embedded in msgpack objects, its up to the UI to parse those and display to the user in whatever way it can. After the msgpack UI is finished, a new project for hosting a ncurses UI will be created. |
I should also add that my own libvterm / pangoterm also supports the standard SGR 38:2:rrr:ggg:bbb format for RGB8 colour handling. |
@leonerd Would it be reasonable to use libvterm as a replacement for ncurses, or is it lower level? Does anyone have experience with termbox?
slang is probably not an option since it's GPL: http://www.jedsoft.org/slang/ |
I think you mean libtickit. :) But yes; it's quite similar. For neovim you'll likely want to use the highest layer that currently exists in the C library; the renderbuffer layer. See http://home.leonerd.org.uk/code/libtickit/doc/tickit_renderbuffer.7.html. At some point later, I may have a porting of the Window layer from the Perl library. This will help manage rendering nested/overlapping/etc.. regions using the renderbuffer, and routes input events via focus management. Some of those issues might not be important for neovim - maybe renderbuffer will be sufficient. |
@leonerd Good info as usual, thanks. |
@leonerd I am wondering whether you support incompatible It may appear that somebody (libtickit?) will have to write a set of hacks just to answer the last question. |
@leonerd By the way, why this list:
is lacking blink attribute ( |
@ZyX-I I suspect the choice of colon or semicolon format for SGR colours can be determined by using DECRQSS on SGR, and parsing the result. This is also handy for detecting if the terminal supports 256 palette or 24bit RGB8 modes in the first place. I'll see what I can come up with; though in the short term I doubt I'll manage to get very much in. As to the lack of blink, that's an easy one to add - it's just another set of bits on top of what it already has. |
@ZyX-I libtickit now supports blink, as of last night. |
No Terminal.app support either. |
Now that the new tui has been merged, what else is needed to support true color nvim in the terminal? |
This PR 😄 |
This is awesome @tarruda, thank you so much! I wanted to donate to the Neovim project for a long time and this it the perfect opportunity 😄 |
Linux v3.13 parses and discards extended color codes: torvalds/linux@3415097 Linux v3.16 translates them to the closest VGA color: torvalds/linux@cec5b2a tmux v2.2 appears to have gained support: ThomasAdam/tmux@427b820 |
…_file Do not use 'cat' to create a temp file.
yeah it works in tmux now, please update the list |
$ LC_ALL=en_US.UTF-8 MANROFFSEQ='' MANWIDTH=80 man --warnings -E UTF-8 -l -Tutf8 -Z man/nvim.1 >/dev/null mdoc warning: A .Bl directive has no matching .El (neovim#59)
See the support/patches for original VIm https://bitbucket.org/ZyX_I/vim/commits/branch/24-bit-xterm
Also, ncurses is not going to have support for that (thanks its author!).
And now it is supported by major part of terminal applications.
Here is the addition info about true colors:
Colors in terminal
It's a common confusion about terminal colors... Actually we have this:
The 256 color palete is configured at start, and it's a 666 cube of
colors, each of them defined as a 24bit (888 rgb) color.
This means that current support can only display 256 different colors
in the terminal, while truecolor means that you can display 16 milion
different colors at the same time.
Truecolor escape codes doesnt uses a color palete. It just specifies the
color itself.
Here's a test case:
Keep in mind that it is possible to use both ';' and ':' as parameters delimiter.
According to Wikipedia[1], this is only supported by xterm and konsole.
[1] https://en.wikipedia.org/wiki/ANSI_color
Here are terminals discussions:
Now supporting truecolor
But there are bunch of libvte-based terminals for GTK2 so they are listed in the another section.
Parsing ANSI color sequences, but approximating them to 256 palette
Note about colour differences: a) RGB axes are not orthogonal, so you cannot use sqrt(R^2+G^2+B^2) formula, b) for colour differences there is more correct (but much more complex) CIEDE2000 formula (which may easily blow up performance if used blindly) [2].
[2] #793 (comment)
NOT supporting truecolor
Terminal multiplexers
[3] Currently you can use tmux_escape option as a workaround if you want true color in shell run under tmux. No true color in tmux statusline though.
Here are another console programs discussions:
Supporting True Color:
Not supporting True Color:
Want to back this issue? Place a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: