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.

  • 5
    Don't set $TERM in .bashrc; it's just asking for this kind of problem.
    – geekosaur
    May 13 '12 at 19:41

tmux is a terminal emulator, since each pane must behave as a separate terminal; its emulation is not exactly the same as that of xterm or gnome-terminal, for historical reasons (it instead matches screen, 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 understand xterm-256color, for example).


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.