Tmux mouse scrolling without altering copy/paste

clipboardscrollingtmux

I'm having difficultly finding an explanation for allowing the OS default copy/paste capabilities (i.e. highlight a portion of text and then use standard shortcut or right click menu) and allow mouse scrolling at the same time. Mouse mode turns on tmux's own copy/paste system, but leaving it off removes the mouse scrolling. As I'm switching between an IDE, browser, and terminal with tmux I would like the controls to be consistent between all of them. Is there a way to have the standard OS copy/paste controls while also allowing the mouse to scroll in tmux?

(Note: I originally asked, but deleted, this question on SO. I decided it was more appropriate here.)

Best Answer

It depends on whether you are relying upon tmux to interpret the wheel-mouse, or not. If that's tmux — no, you cannot, because tmux would only see the wheel mouse events if it turned on the terminal's mouse operations.

Without turning on the mouse operations, some terminals may send up/down cursor keys to the application when it has switched to the alternate screen. VTE (gnome-terminal) has done that unconditionally for a few years. The same feature is an option(alternateScroll) in xterm. tmux switches to the alternate screen if the terminal description has that in the terminfo smcup and rmcup capabilities. While in the alternate screen, normally (except for this fairly recent up/down cursor feature), the wheel mouse would have no effect on the terminal.

So... you can get some limited use of the wheel mouse while running tmux, and it depends on the terminal and how it is configured.

Related Question