Mouse support in TMUX 2.1

Stefan Hoffmann
<pretty/code>
Published in
1 min readDec 11, 2015

The mouse support will no longer work after you upgraded to tmux 2.1 because it has been completely reworked.

To enable it again in the new version first remove the old settings:

set -g mode-mouse on
set -g mouse-resize-pane on
set -g mouse-select-pane on
set -g mouse-select-window on

And insert this single line into your config:

set-option -g -q mode-mouse on

Now you can use your mouse again to change window/panes and resize them.
If you also need mouse scrolling in your panes you need to include this hack in your tmux config:

bind -n WheelUpPane if-shell -F -t = “#{mouse_any_flag}” “send-keys -M” “if -Ft= ‘#{pane_in_mode}’ ‘send-keys -M’ ‘copy-mode -e; send-keys -M’“

Now you can scroll up to go backwards in the history and scroll down to go forward.

This also automatically exits scroll mode when you arrived at the very bottom.

--

--