Make tmux scroll from the trackpad

itermtmux

I want to set up iTerm2 to pass scroll events to tmux, so I can trivially enter (and exit) scrollback mode for whatever pane is active. Is this possible to do with iTerm2, or automation of some sort, or …?

Best Answer

The mode is referred to as "copy mode" and as long as you're running tmux 1.5 or higher you can add:

setw -g mode-mouse on

to your ~/.tmux.conf file and tmux will automatically enter and exit copy mode when you use the scroll wheel on your mouse.

As a bonus, this option allows you to select the tmux pane with your mouse:

set -g mouse-select-pane on