0

I know I can use shift and mark to copy. But, I cannnot mouse scroll inside tmux when I do that. Also when i mark text in tmux normally also, I cant scroll.

How do I achieve

  1. mouse scroll with marking?
  2. copying the mouse scrolled marking?

Environment tmux 2.3 ( can't upgrade with apt cuz im in legacy system - an Rpi) win 10 kitty

~/.tmux.conf contains

set -g mouse on
bind-key -t vi-copy MouseDragEnd1Pane copy-pipe "xclip -in -selection clipboard"

2 Answers 2

1

<ctrl> <B> is the keycombo for interfacing with tmux. Once you have hit this key combo, you may let go, and then proceed to issue further key sequences(not push and hold, just tapped in sequence).

Once you have hit <ctrl> <B>:

Use PgUp to scroll the pane upwards, and PgDown for downwards. Use the arrow keys to move focus from one pane to the next, % to split vertically and " to split horizontally. just type exit to close a pane or use x. If you have issues with copying text when you have multiple panes open, you can fullscreen the current pane using z, which will negate the issue of copying text from multiple panes.

If you require to copy more than a shells height worth of text, you probably want to use the OS buffer instead. Hit v to enter visual mode, and j to select from the current position, until the next line. Repeat j until all desired text is selected, and finally type "*y which will yank to the OS buffer, you may then use "*p to paste: Copy and paste

Hope this helps!

2
  • 1
    i meant scroll with mouse. ill update that in my question Oct 1, 2020 at 9:32
  • The bind you posted should indeed allow tmux to scroll and copy, however if you are trying to do the same with vim you will have issues. vim requires its own set mouse=a in order to manipulate selections with the mouse. So far, I am unable to make the two work in conjunction, as they appear to be competing for selection. Try disabling tmux to test out vim's mouse interaction.
    – paddywan
    Oct 1, 2020 at 11:55
0

after highlighting with mouse, Ctrl+b and ] pastes the selection. I was able to scroll with different terminal software. Cant figure out how to make it work with kitty though.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.