brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: Space starts a selection in tmux copy mode and Enter copies it

Tmux
~/tips/tip-tmux-select-and-copy

Enter # copy and leave copy mode

Selects text in copy mode with the keyboard and copies it into tmux's paste buffer.

Copying with the keyboard takes four steps once you know them.

Ctrl-b [     # enter copy mode
Space        # start selecting (vi keys)
Enter        # copy and leave copy mode
Ctrl-b ]     # paste

With mode-keys vi the selection starts on Space and Enter copies it. With the default emacs keys it is Ctrl-Space to start and Enter or Alt-w to copy.

The text lands in tmux’s own buffer, not in the system clipboard. Ctrl-b ] pastes from that buffer into the pane you are in.

Getting it into the system clipboard needs extra setup that depends on your terminal and operating system, so treat that as a separate step.

Try it without risk: start a throwaway session with tmux new -s scratch, use the shortcut or command above there, look at what changes, and close it again with tmux kill-session -t scratch.

Further reading: tmux manual page (OpenBSD, official), tmux wiki: Getting Started (official)

More Tmux tips tmux new -d -s report -x 200 -y 50 'top' tmux wait-for build-done set -g allow-passthrough on tmux kill-server Ctrl-b [ All Tmux tips (125) All topics

Link