4

I am using konsole-4.14.3, tmux-2.6, vim-7.4.1938 and my shell is bash. Outside tmux, my vim color scheme works properly. However, inside tmux the colors are completely different. I kind of know what the problem is, but not sure how to solve it.

The default $TERM value for my terminal is xterm. If I add

set -g default-terminal screen-256color
set -g terminal-overrides ',screen-256color:Tc'

to my ~/.tmux.conf and export TERM=screen-256color to my ~/.bashrc, vim colors work properly in tmux. However, changing the value of TERM makes line wrapping to stop working both outside and inside tmux.

How should I fix this?

niko
  • 428

1 Answers1

4

I found a fix. I removed the lines in ~/.tmux.conf that set the terminal to screen-256color so that tmux chooses the default. I did NOT change $TERM in my ~/.bashrc or anywhere else. Then I started tmux with tmux -2 which forces tmux to use 256 colors. Make sure to source your conf with :source-file ~/.tmux.conf and to restart your terminal. Manually setting tmux to screen-256color or xterm-256color did not work for me as it caused line-wrapping to stop working. Note that although my default $TERM value was xterm, konsole would still support 256 colors.

niko
  • 428