1

Does anybody know how, in Ubuntu using tmux, to copy an entire terminal and/or copy multiple terminal pages?

The usual trick I use in the terminal in a non-tmux session is to scroll up to the top of where I'd like to highlight, left click and drag some text, then release the left mouse button, then scroll down a few screens (or however far is desired) then hold shift, then left click and drag and it will include all the lines where I started highlighting above all the way down to where I started the 2nd highlighting. This trick does not work in tmux however, since when I start a new highlight area, even if holding shift, tmux looses the previous highlight area.

Many of the other posts on the various interwebs have instructions to the effect of:

  1. Enter ‘copy mode’ by pressing CTRL+b, [.
  2. Use the arrow keys to go to the position from where you want to start copying. 3) Press CTRL+SPACE to start copying.
  3. Use arrow keys to go to the end of text you want to copy. Press ALT+w or CTRL+w to copy into Tmux buffer.
  4. Press CTRL+b, ] to paste in a possibly different Tmux pane/window.

But when I do this, on step 4 nothing gets highlighted, i.e. Ctrl + Space in step 3 does not seem to enter a copy mode. I'm not sure if this is due to certain hotkeys being preempted by Ubuntu or for some other reason.

I'm using Ubuntu 20.04 and tmux 2.8.

Any suggestions?

cdahms
  • 1,773

1 Answers1

0

You can copy entire tmux pane via :

  1. go to the start of the pane in copy mode
  2. start select text you want
  3. go to the ends of pane
  4. copy the text

In tmux vi-mode in copy-mode:

  1. gg
  2. V (selec-line select via line)
  3. G
  4. {copy shortcut} (default is Enter in copy-mode

Alos, you can use tmux plugin tmux-copycat, tmux-yank. There are useful and might save you many time for configure your tmux.

laudai
  • 51