I just discovered why I was having a lot of confusion. I, like others here, was having a difficult time getting the default-terminal setting to take effect. I remembered that I had a tmux session in the background. I re-attached my session, closed out my processes, and closed ALL tmux processes. The next time I restarted tmux the default-terminal setting in .tmux.conf
began to take effect. I don't know if others are doing this as well but I recommend closing all tmux processes before modifying the .tmux.conf
file.
I got my setup to work on my local machine (OSX 10.9.5 with iTerm2) without any modification to .bashrc
or .bash_profile
. All I did was add the line set -g default-terminal "xterm-256color"
to ~/.tmux.conf
and restarted all tmux processes.
I got my remote setup (ssh to Ubuntu 14.04) to work exactly the same way without any modifications to .bashrc
. I simply added set -g default-terminal "xterm-256color"
to ~/.tmux.conf
on my remote machine and restarted all remote tmux processes.
You can test what Vim is seeing by doing echo $TERM
from within a tmux session. It kept saying screen
as the value until I restarted all tmux processes, at which point it reflected xterm-256color
as expected.
Hope that helps.
$ tmux -2
? – romainl