Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

When SSH'd into another machine, I use Vim as my text editor, and I'm trying to add Tmux to my tool set as well. However, when I use vim through Tmux, the colors are completely wrong, and Vim is unusable. Even when not using Tmux, the colors are slightly off, but it's still usable.

Here's a screenshot of Vim by itself (not using Tmux): Vim by itself

Here's a screenshot of Vim with Tmux: Vim with Tmux

There's nothing in my ~/.tmux.conf, and I don't have any color modifications in my ~/.bashrc. Can anyone shed some light on why this is occurring? Thank you.

share|improve this question
1  
Have you checked what your TERM environment variable is under both bash and tmux? –  kejadlen Jan 11 '12 at 18:41

1 Answer 1

I've got a solution:

Do this command in each environments.

for i in {0..255} ; do
    printf "\x1b[38;5;${i}mcolour${i}\n"
done

Though my tmux has:

set-option -g default-terminal screen-256color

but in tmux, the colour is bad and different than urxvt (the result in urxvt is same as xterm).

So launch tmux by

tmux -2

This forces tmux to behave as if it's running terminal can output 256 colours.

Then run your vim.

Did your problem fixed?

share|improve this answer
    
Thanks! I had my term setup right and had the screen-256color option. the tmux -2 fixed it for me. –  mouche Apr 19 '12 at 8:02

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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