How to set window title from vim in tmux window

cscope, ctags, tmux, vim

Solution

The issue was because `$TERM` in `bash` is `xterm` whereas inside `tmux` `$TERM` is `screen`. I updated my `.vimrc` to select the correct term.

if &term == "screen"
  set t_ts=^[k
  set t_fs=^[\
endif
if &term == "screen" || &term == "xterm"
  set title
endif

To get the escape sequence `^[` in vim, press Ctrl-V then Esc.

Problem

I use `cscope+ctags+vim` to browse/edit my source code. I have put `set title` in my `.vimrc` to display the `filename` I am currently editing/reading in the window title bar. This works perfectly in bash. However when I open `vim` from `tmux`, the window title bar doesn't not changes. How to fix this?

Original source

Related problems