4

I am using tmux, and recently found out that the same vim colorshemes inside and outside of tmux have different colors

Left is tmux in gnome-terminal, right is plain gnome-terminal, gnome-terminal has default colors:

![Left is <code>tmux</code> in <code>gnome-terminal</code>, right is plain <code>gnome-terminal</code>

EDIT: At closer look, the style does change too (look at bold etc).

Both terminals are 256-colored ones (gnome-terminal indicates himself as xterm-256color, tmux as tmux-256color, see ncurses-term package), vim sees that too (:set t_Co gives 256). I compared their color representations via

for i in `seq 0 255` ; do echo -e "$i: \e[48;5;${i}m                  \e[0m"; done

And got the same palettes:

Color paletes

I think tmux should just pass these colors to gnome-terminal, but when why vim changes?

Can I fix this? I think gnome-terminal ones are better, and want tmux to use them.

2
  • Which color scheme is that? Please post a copy -- it might be using rgb colors, not just 256. Commented May 28, 2016 at 23:54
  • Actually, Vim was loading desert colorsheme instead of default, see my answer. Commented May 29, 2016 at 11:17

1 Answer 1

2

For some reason, it was just a Vim issue: when started in tmux, it loaded default colorsheme, but when started from plain terminal, it loaded desert colorscheme but still calling it default when asked via :colorsheme. Forcing :colorsheme default resolved an issue, so I added colorsheme line in my ~/.vimrc and now it's OK.

I have no idea why Vim was doing that stuff, but forcing desired colorsheme works fine.

1
  • 1
    "I have no idea why Vim was doing that stuff": See this answer. Commented Mar 4, 2017 at 2:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .