I am having the same problem like the questioner in 256 color support for vim background in tmux.
In my normal terminal with zsh
, I have no background color issues in vim
, but when I run it inside tmux
, I get issues with the background colors.
Apparently, there is a problem with using screen
instead of xterm
:
Outside Tmux: echo $TERM
results in screen
Inside Tmux: echo $TERM
results in xterm
In my .zshrc and .tmux.conf I have set
TERM=screen-256color
but it doesn't effect anything. (I also tried TERM=screen
)
How can I force tmux
to use screen
?
EDIT:
thanks to htor, I added set -g default-terminal "screen"
(also tried set -g default-terminal "screen-256color"
) in .tmux.conf and in .zshrc export TERM=screen-256color
.
Now I get:
Outside Tmux: echo $TERM
results in screen-256color
Inside Tmux: echo $TERM
results in echoscreen-256color
(<- looks a little bit weird with, is the output correct?)
What else can I do to solve the background color issue in vim inside tmux?