LoginSignup
156
136

More than 5 years have passed since last update.

tmux v2.1からmouse関連の設定が変わった

Last updated at Posted at 2015-10-28

El Capitanをクリーンインストールしたので、brew関連もセットアップし直してtmuxを起動したところ、
tmuxのmouse設定が置き換わってました、という話です。

バージョン

$ tmux -V
tmux 2.1

事象

tmux起動するとこんなエラーが出るようになった。

.../.tmux.conf:23: unknown option: mouse-select-pane
.../.tmux.conf:24: unknown option: mouse-select-window
.../.tmux.conf:25: unknown option: mouse-resize-pane
.../.tmux.conf:26: unknown option: mode-mouse

どうもmouse関連の設定が無くなった?らしい。で、tmuxのサイトを調べてみた。

https://tmux.github.io/changelogから引用

  • 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.

mouseだけでよくなったらしい。

対処

mouse-xxxとかmode-mouseは外して、mouse onに置き換え。

.tmux.conf
# history size
set-option -g history-limit 10000
#set-option -g mouse-select-pane on
#set-option -g mouse-select-window on
#set-option -g mouse-resize-pane on
#set-option -g mode-mouse on
set-option -g mouse on

後から気づいたんだけど、mouse onだけだとスクリーンがスクロールしないことが判明。
いろいろググった結果、さらに設定を追加しました。

.tmux.conf
set-option -g mouse on
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'copy-mode -e'"

issueにコメント載せている@NHDalyは、それらを集約してtmuxプラグインを作成した模様。
こういう展開はいいなー。

tmuxも結構長いこと使っているので、他にも気づかないうちに変わっている箇所があるのかも。

156
136
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
156
136