linuxtmuxrxvt

Selecting text in tmux under rxvt-unicode (urxvt)


I've just recently begun experimenting with urxvt as a terminal emulator rather than xterm. I'm a heavy tmux user, so having both work seamlessly together is a must.

I've noticed that when running tmux inside urxvt, there is some odd behavior when selecting text. I hold shift, use the mouse to select text, and the text is highlighted in yellow (as if tmux is still handling it) but then blinks and flashes to a black background -- almost as if urxvt and tmux are competing for control of the selection. Does that make sense?

I've test this with zero (except enabling the mouse in tmux) personal configuration options in both tmux and urxvt.

In xterm, when I would hold shift and select text I would notice that it would highlight in reverse colors (as opposed to tmux's yellow background). In urxvt, the selected text still seems to be controlled by tmux.

Any ideas on how to fix this weird behavior?

I'd even be interested in some tips or keywords on how to uncover the problem here. Any developers familiar with the codebase that understand why mouse-selection works fine in xterm, but not with urxvt term?


Solution

  • Thanks to nicm from this issue in the tmux's github repository, the problem you described was solved for me (for tmux 2.1 and urxvt 9.21):

    You can disable tmux entering copy mode when dragging by unbinding the MouseDrag1Pane key binding.

    In .tmux.conf, add:

    unbind -n MouseDrag1Pane