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

Copy when scrolling up #658

Open
chevalierNoir opened this issue Jun 23, 2023 · 1 comment
Open

Copy when scrolling up #658

chevalierNoir opened this issue Jun 23, 2023 · 1 comment

Comments

@chevalierNoir
Copy link

Is it possible to select a region by dragging mouse and then copy it while scrolling up? While holding the fn key (mac keyboard) and dragging mouse, I can select one text region and copy it. But if I scroll up a bit with my mouse (mouse mode on), it doesn't work any more. When I release the mouse, the cursor will go down to the bottom immediately and nothing got selected then copied. Thanks!

@gpakosz
Copy link
Owner

gpakosz commented Oct 12, 2024

Hello @chevalierNoir 👋

Sorry for the very late answer.

To see default tmux bindings related to mouse mode, you can do

$ tmux -f /dev/null -L test list-keys | grep Mouse

You can see that the default bindings for MouseDragEnd1Pane are

bind-key    -T copy-mode    MouseDragEnd1Pane      send-keys -X copy-pipe-and-cancel
bind-key    -T copy-mode-vi MouseDragEnd1Pane      send-keys -X copy-pipe-and-cancel

With Oh my tmux!, and tmux_conf_copy_to_os_clipboard=true, you will see

bind-key    -T copy-mode    MouseDragEnd1Pane      send-keys -X copy-pipe-and-cancel pbcopy
bind-key    -T copy-mode-vi MouseDragEnd1Pane      send-keys -X copy-pipe-and-cancel pbcopy

You could use your .local customization file to stop using the -and-cancel variants, e.g.

bind-key    -T copy-mode    MouseDragEnd1Pane      send-keys -X copy-pipe
bind-key    -T copy-mode-vi MouseDragEnd1Pane      send-keys -X copy-pipe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment