I've just started using tmux and I'm having trouble with my colorscheme in vim
. I've using the zenburn color scheme and it works fine with the default terminal settings in Ubuntu 10.04.
However, when I run vim
in a tmux session the colors don't look good at all. I've done some searches to try to figure out what the problem is and one thing I found is this question where the solution involved allowing tmux to using screen-256color
and removing the setting in .bashrc
which was setting it to xterm-256color
.
So I am curious what the difference is between xterm-256color
and screen-256color
but I haven't found a good explanation yet.
Best Answer
tmux
is a terminal emulator, since each pane must behave as a separate terminal; its emulation is not exactly the same as that ofxterm
orgnome-terminal
, for historical reasons (it instead matchesscreen
, which predates most of the GUI terminal emulators). It therefore requires a different terminal description to behave properly.Setting
$TERM
manually is usually a bad idea specifically for this reason; it will usually be set correctly by itself, with some exceptions usually related to compatibility (older Solaris doesn't understandxterm-256color
, for example).