diff --git a/tmux.conf b/tmux.conf index 5f4cce2..9963892 100644 --- a/tmux.conf +++ b/tmux.conf @@ -151,12 +151,14 @@ if-shell 'command -v pbcopy >/dev/null' \ bind-key -Tcopy-mode-vi Escape send -X cancel # cancel v mode bind-key -Tcopy-mode-vi ^v send -X rectangle-toggle # cancel v mode -bind-key -T copy-mode-vi MouseDown1Pane select-pane -t = \; send-keys -X cancel +bind-key -T copy-mode-vi MouseDown1Pane select-pane -t = \; send-keys -X clear-selection +bind-key -T copy-mode-vi MouseUp1Pane select-pane -t = \; send-keys -X cancel bind -n MouseDrag1Pane if -Ft= '#{mouse_any_flag}' 'if -Ft= \"#{pane_in_mode}\" \"copy-mode -eM\" \"send-keys -M\"' 'copy-mode -eM' # (note) {{{ -# The `bind-key -T copy-m...` makes a single click leave copy-mode: back to -# the prompt, selection dropped. A drag still selects (MouseDrag1Pane below -# re-enters copy-mode) and a click on another pane still switches to it. +# A plain click (MouseDown then MouseUp, no drag) leaves copy-mode: back to +# the prompt, selection dropped. A drag sends MouseDrag/MouseDragEnd instead +# of MouseUp, so it keeps the scroll position and selects as usual. A click +# on another pane still switches to it. # The `bind -n MouseDrag1Pane if -Ft= ...` changes the default binding of # MouseDrag1Pane, the only difference is that we use `copy-mode -eM` instead # of `copy-mode -M`, so that WheelDownPane can trigger copy-mode to exit when