My understanding is that ansi-term
only supports 8 colors (a good discussion of this in reddit here).
Meanwhile, an increasing number of terminal emulators (e.g. tmux
or iTerm2
in OS X) support True color
(24 bit, i.e. 16 million colors). A good list can be found here.
- If the 8-color cap is specific to
ansi-term
, are there any other packages for terminal emulation that are trying to address this limitation? - Are there any plans to bring
True color
support to a terminal emulator in Emacs?
And maybe to confirm:
- Is there any way to effectively have more than 8 colors in
ansi-term
buffers? - Is tweaking
ansi-color-names-vector
still the recommended way of settingansi-term
colors in Emacs25
?
How to test if an emulator supports "True color":
Here is a snippet from the link above that would test if the emulator supports True colors:
awk 'BEGIN{
s="/\\/\\/\\/\\/\\"; s=s s s s s s s s;
for (colnum = 0; colnum<77; colnum++) {
r = 255-(colnum*255/76);
g = (colnum*510/76);
b = (colnum*255/76);
if (g>255) g = 510-g;
printf "\033[48;2;%d;%d;%dm", r,g,b;
printf "\033[38;2;%d;%d;%dm", 255-r,255-g,255-b;
printf "%s\033[0m", substr(s,colnum+1,1);
}
printf "\n";
}'
If it is supported, the bottom line would display a nice gradient like the one shown below:
From what I read, NeoVim (a VIM editor) added support for it in 2015, and there was a request made to Emacs bugs to add it.
ansi-color-names-vector
as a variable I can customize. Besides that, I runmulti-term
and with zsh as shell. Your script does not produce a positive output :-(