When using less in OS X, how can I customize the colors with with things are displayed? When I run less within an ansi-term in Emacs the colors don't come out nicely.
$ less --version
less 418
Copyright (C) 1984-2007 Mark Nudelman
color-managementcolorsemacsless
When using less in OS X, how can I customize the colors with with things are displayed? When I run less within an ansi-term in Emacs the colors don't come out nicely.
$ less --version
less 418
Copyright (C) 1984-2007 Mark Nudelman
Best Answer
For OSX, this refers to Emacs 22.1.1; Fedora with Emacs 24 has the same behavior.
Emac's ansi-term supports 8 colors. That is all that ANSI specified, and "ansi-term" is named appropriately. The
eterm-color
terminal description in ncurses is used for this terminal type. Emacs setsTERM
to this value (see source):If you override
TERM
, e.g., to tell applications that it has more colors, then the extra colors will not be used. Likewise, hard-coded applications which ignore the terminal database cannot use extra colors either.While Emacs can use more than 8 colors in a terminal, ansi-term does not. Reading the source, look for
term-ansi-current-color
, and see that there is only logic for 30-37, 39, 40-47 and 49:You may be able to change the palette of colors used by your terminal, but there is no way to make ansi-term differ from that (it will use the first 8 colors even if Emacs can use 256).
Further reading:
For Emacs other than ansi-term:
Also: