Read more

HowTo: Easier selecting and copying of text in tmux

Florian Heinle
July 06, 2023Software engineer at makandra GmbH

When using tmux, selecting and copying multiple lines of text can be a hassle, especially when using splits (highlighting lines will cross pane borders, copying contents from the other pane too) and when the user wishes to copy (thus, select) lines that have already scrolled out of the viewport in the current pane.

Illustration online protection

Rails Long Term Support

Rails LTS provides security patches for old versions of Ruby on Rails (2.3, 3.2, 4.2 and 5.2)

  • Prevents you from data breaches and liability risks
  • Upgrade at your own pace
  • Works with modern Rubies
Read more Show archive.org snapshot

One idea would be to enable mouse mode in tmux, which makes the selection tmux aware. However, this will no longer populate the selection clipboard of the graphical environment, limiting copying and pasting to the same tmux instance. Fortunately there's a plugin that makes tmux' clipboard sync to the graphical environment's selection clipboard: tmux-yank Show archive.org snapshot

When using the tmux plugin manager Show archive.org snapshot , the solution is easy, in our .tmux.conf:

set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g mouse on

the plugin can also be installed manually by cloning the repository Show archive.org snapshot .

Posted by Florian Heinle to makandra Operations (2023-07-06 16:55)