久しぶりに tmux を再起動したらこんな警告が出るようになった。
/Users/user_name/.tmux.conf:16: unknown option: mode-mouse /Users/user_name/.tmux.conf:17: unknown option: mouse-resize-pane /Users/user_name/.tmux.conf:18: unknown option: mouse-select-pane /Users/user_name/.tmux.conf:19: unknown option: mouse-select-window
tmux 2.1からmouse系のオプションが1つに纏められた模様。
Incompatible Changes ==================== * Mouse-mode has been rewritten. There's now no longer options for: - mouse-resize-pane - mouse-select-pane - mouse-select-window - mode-mouse Instead there is just one option: 'mouse' which turns on mouse support entirely.
https://raw.githubusercontent.com/tmux/tmux/master/CHANGES
上記4つのオプションを消して、
set -g mouse on
を追加したら問題なく動作するようになった。
2015-11-28 追記
スクロール時に自動でコピーモードにならなくなっていた。 GitHubでもissueがあがっていて、そこに解決方法が載っていた。
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'" bind -n WheelDownPane select-pane -t= \; send-keys -M
Mouse scrolling in tmux 2.1 on OSX no longer auto-starts · Issue #145 · tmux/tmux · GitHub
上記2行で、
- スクロールアップするとコピーモードに入る
- 最後までスクロールダウンするとコピーモードを抜ける
が動作するようになる。
ちょっと手元の環境ではtmuxを再起動しても反映されず、tmuxのプロセスを直接killしてから立ち上げてやっと有効になった。