Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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\\"

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.

share|improve this question

1 Answer 1

It's due to limitations in the mouse reporting protocol in terminals: "The original X10 mouse protocol limits the C x and C y ordinates to 223 (=255 - 32)" see this link

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.