From 332c842c5c830d27c2f4dab9d590311ad3e78766 Mon Sep 17 00:00:00 2001 From: Nick Nisi Date: Mon, 19 Oct 2015 19:58:59 -0500 Subject: [PATCH] correct mouse behavior in tmux 2.1 Make tmux behave like it did in 2.0 with these changes. Credits to this reddit thread: https://www.reddit.com/r/tmux/comments/3paqoi/tmux_21_has_been_released/cw552qd --- tmux/tmux.conf.symlink | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tmux/tmux.conf.symlink b/tmux/tmux.conf.symlink index 30a597a..5cf5fa9 100644 --- a/tmux/tmux.conf.symlink +++ b/tmux/tmux.conf.symlink @@ -78,9 +78,17 @@ bind -r K resize-pane -U 10 bind -r L resize-pane -R 10 # enable mouse support for switching panes/windows -# NOTE: This breaks selecting/copying text on OSX -# To select text as expected, hold Option to disable it (iTerm2) setw -g mouse on +# set-option -g -q mouse on + +bind-key -T root PPage if-shell -F "#{alternate_on}" "send-keys PPage" "copy-mode -e; send-keys PPage" +bind-key -t vi-copy PPage page-up +bind-key -t vi-copy NPage page-down + +bind -T root WheelUpPane if-shell -F -t = "#{alternate_on}" "select-pane -t =; send-keys -M" "select-pane -t =; copy-mode -e; send-keys -M" +bind -T root WheelDownPane if-shell -F -t = "#{alternate_on}" "select-pane -t =; send-keys -M" "select-pane -t =; send-keys -M" +bind-key -t vi-copy WheelUpPane halfpage-up +bind-key -t vi-copy WheelDownPane halfpage-down # maximizing and restoring windows unbind Up