I'm trying to get a custom color-theme (solarized) setup for my emacs that utilizes a 16 color palette, which I've already set up for my terminal (gnome-terminal).
When running emacs from a normal terminal with TERM=xterm-256color
, I can correctly get M-x list-colors-display
to show all 16 ansi colors, e.g. red, green, brightgreen, brightred, etc.
However, when running it from within tmux and TERM=screen-256color
, M-x list-colors-display
only lists the basic 8 colors, and is missing the extended bright colors. Under both settings, evaluating (display-color-cells)
reports 256 colors. The only references to the bright colors that I can find are in lisp/term/xterm.el and lisp/term/rxvt.el, so it would seem the issue is in the TERM
setting.
For tmux to work properly the TERM
must be set to screen or screen-256color, so setting TERM differently is out. I have had some luck using an alias:
alias emacs='TERM=xterm-256color emacs'
Is there a better way than this to force emacs to allow the use of all 16 ansi colors?