Mouse scrolling and selection in terminal using tmux
I just switched from GNU screen to tmux 2.0 and I was surprised to find that I can no longer scroll through the terminal history with the mouse wheel and Shift-PgUp/ Shift-PgDn.
This is a big trip for me. How do I make the terminal scrollable using tmux?
PS. I know what I can do set-window-option -g mode-mouse on
to use the mouse wheel to scroll through the tmux buffer and not the terminal / strong>. Another side effect of this parameter is that I can no longer make mouse selections in the usual way - I have to Shiftleft-click.
IOW: How do I tell tmux to send all mouse events to the terminal emulator?
PPS. Ubuntu 15.10; gnome terminal; the scrollbars are clearly visible on the right, but in the section screen
they show that only a small portion of the buffer is displayed, and below tmux
they indicate that there is nothing to scroll.
I suspect your problem is that the lines don't fit in the scroll buffer at all, not tmux, grabbing the mouse and keys.
Tmux uses an "alternate screen buffer" by default (you may notice that if you have text on the screen then attach and detach tmux, the text will return). Many terminal emulators will not place text that is scrolled or erased in this mode in the scroll buffer. To disable this, do the following:
set -g terminal-overrides 'xterm*:smcup@:rmcup@'
Where xterm*
is what your terminal reports itself, as in the $ TERM environment variable. You may need to disconnect the reset terminal and reconnect for it to work if you set the parameter interactively.
NOTE. If you are using termcap instead of terminfo, use ti
and te
instead of smcup
/ rmcup
.