4
3
I use vim inside tmux inside urxvt, and the mouse works perfectly well for clicking and selecting text, except when I want to click too far to the right.
It seems to be related to the distance in number of columns from the left. When I go beyond column ~200 (not sure about the exact number), clicking simply does nothing.
Note that it's not related to a vim window: with two vim windows taking ~150 columns each, clicking will not work after the ~50th column in the second window. It's related to the whole vim session.
Also note that clicking far away in a big tmux pane (>200 columns) works perfectly.
In my .tmux.conf
I have this line:
set -g default-terminal "screen-256color"
and in my .vimrc
I have this:
if &term =~ "^screen"
autocmd VimEnter * silent !echo -ne "\033Ptmux;\033\033]12;7\007\033\\"
let &t_SI = "\<Esc>Ptmux;\<Esc>\<Esc>]12;5\x7\<Esc>\\"
let &t_EI = "\<Esc>Ptmux;\<Esc>\<Esc>]12;7\x7\<Esc>\\"
autocmd VimLeave * silent !echo -ne "\033Ptmux;\033\033]12;14\007\033\\"
end
It changes the cursor's color depending on the editing mode of vim, and it works, meaning that tmux really sets $TERM
to "screen-256color" — but I don't know if this has any relevance with my mouse problem.
I'm running Ubuntu 12.04, vim 7.3, tmux 1.6 and rxvt-unicode 9.14.
Does anybody have an idea about what is causing this problem? Thanks.
Update: I now use xterm and it works. I thought urxvt was required for unicode support, but believe it or not, xterm has unicode support too.
Just throwing in my +1; I, too, experience this problem. It only manifests inside a vim that is inside a tmux; and it manifests regardless of the respective configuration files. (For me, it's precisely column 223 every time.) – ELLIOTTCABLE – 2015-05-01T00:35:33.250
I've hit up the
– ELLIOTTCABLE – 2015-05-01T04:10:08.983tmux
mailing-list; we'll see if this is a bug. http://sourceforge.net/p/tmux/mailman/message/34074071/I updated the question to say that I've fixed the problem by switching to xterm. I know it's not the best solution but it works. – paps – 2015-05-02T02:42:46.153