Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tmux: disable "mouse-drag-ended--resets-viewport" behavior #22

Closed
bew opened this issue Feb 10, 2020 · 2 comments
Closed

tmux: disable "mouse-drag-ended--resets-viewport" behavior #22

bew opened this issue Feb 10, 2020 · 2 comments

Comments

@bew
Copy link
Owner

bew commented Feb 10, 2020

Can be disabled in recent versions of tmux:
tmux/tmux#140 (near the bottom of the issue)

@bew bew transferred this issue from bew/ConfigMisc Feb 11, 2020
@bew
Copy link
Owner Author

bew commented Feb 15, 2021

tmux/tmux#140 (comment) is the correct solution
Extract:

set -g mouse on

# disable "release mouse drag to copy and exit copy-mode", ref: https://github.com/tmux/tmux/issues/140
unbind-key -T copy-mode-vi MouseDragEnd1Pane

# since MouseDragEnd1Pane neither exit copy-mode nor clear selection now,
# let single click do selection clearing for us.
bind-key -T copy-mode-vi MouseDown1Pane select-pane\; send-keys -X clear-selection

# this line 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 copy-mode is entered by MouseDrag1Pane
bind -n MouseDrag1Pane if -Ft= '#{mouse_any_flag}' 'if -Ft= \"#{pane_in_mode}\" \"copy-mode -eM\" \"send-keys -M\"' 'copy-mode -eM'

@bew
Copy link
Owner Author

bew commented Mar 13, 2021

Also see tmux rewritting at 2a538c3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant