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 ...?
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
As seen in this related issue: https://stackoverflow.com/questions/11832199/tmux-set-g-mouse-mode-on-doesnt-work
The command to enable scrolling & easy copy to clipboard highlighting is the following:
set -g mouse on
tmux
version 2.1 or higher follow: stackoverflow.com/questions/30185210/… – bits May 30 '16 at 13:36