Methods of payment Abuse

Copy and Paste to tmux

30.05.2023, 17:52

In previous articles, we have already told you what tmux is. Today we will tell you how the copy and paste procedure is performed.

What is the option for?

TMUX has mouse support, which allows you to select text and copy it to the clipboard. To enable mouse support in tmux, add the following line to the .tmux.conf configuration file:

set -g mouse on

After that, you can use the mouse to highlight the text, as in a normal terminal. As soon as you have selected the text, it is automatically copied to the tmux internal buffer. To paste the copied text into another part of the terminal, press `Ctrl +b`, then `]`. This will open a panel for inserting text into the terminal. Paste the text and press `Enter` to close the panel.

In addition, you can use the `Alt +W` keys to copy the selected text to the system clipboard, and `Ctrl + b`, then `#` to view a list of copied text fragments (usually to paste text from previous sessions).

How to copy and paste to tmux

The procedure will be as follows:

  1. Open a terminal and run tmux with the `tmux` command.
  2. Open the desired file or text in another program.
  3. Press `Ctrl + Shift + C` to copy the selected text.
  4. Go to the tmux session where you want to insert the text.
  5. Press `Shift + Insert` or `Ctrl + Shift + V` to paste the copied text.
  6. To exit the copy mode in tmux, press `q`.
  7. Ready! The text is copied and pasted into the tmux session.

As you can see, even an absolute beginner can cope with this task!