Is there a compelling reason why gnome-terminal
(and, under the hood, maybe the VTE
widget) sets $TERM
to xterm
rather than xterm-256color
? Clearly it supports 256 colors.
For a while, I had a line in my .bashrc
/.zshrc
to simply export TERM=xterm-256color
, because that's usually the terminal emulator that I'm using. But then I open up tmux
, and the behavior / colors are wrong in many CLI applications, such as emacs
and htop
, because tmux
will set the TERM
variable to screen-256color, then the shell loads and executes my .*rc
file, which then sets the TERM
incorrectly.
For now, I have:
if [ "$TERM" != "screen-256color" ]; then
export TERM="xterm-256color"
fi
I don't like this, because what if one day I break out my actual VT-220 or use a different terminal emulator?