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
This commit is contained in:
Nick Nisi
2015-10-19 19:58:59 -05:00
parent 7e946ac148
commit 332c842c5c

View File

@@ -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