In tmux
, my terminal's vim
color scheme changes after connecting then immediately disconnecting from a remote server via ssh
. The exact command sequence is:
tmux
vim <my_file> # vim colors correct
ssh <my server>
exit # Immediately disconnect
vim <my_file> # vim colors WRONG
Note: No difference was observed between tmux
and tmux -2
. I also saw no difference in tmux info
before and after the ssh connection.
I am unable to determine why connecting/disconnecting via ssh
affects how vim
runs on my local machine. This only happens with tmux
. It does not happen with my normal terminal.
Color Comparison:
Image Comparison of the Terminal
Setup Info:
- MacOS Mojave 10.14.6
- Terminal: MacOS 2.9.5
- Shell: oh-my-zsh
tmux
: 2.9a (installed viabrew
)vim
: 8.1- Vim Package Manager: Vundle
- Color Scheme: Gruvbox
MWE .zshrc
" Vundle Start
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'morhetz/gruvbox'
call vundle#end()
filetype plugin indent on
" Vundle END
syntax on
colorscheme gruvbox
set background=dark
(Adding set t_Co=256
to .vimrc
seemed to have no effect)
.tmux.conf
set-option -g default-shell /usr/local/bin/zsh
set -g default-terminal "screen-256color"