tmux copy and paste

Updated: 07 May 2023

Enter copy mode
Ctrl+b [

Then, navigate with vim key bindings, space bar to start selection, enter to copy.

Paste back into tmux or vim running inside tmux
Ctrl+b ]

From tmux, transfer text to ‘middle mouse button’ clipboard
echo -n "text for system clipboard" | xclip

From tmux, transfer text to ‘clipboard’ clipboard
echo -n "text for system clipboard" | xclip -sel clip

tmux show-buffer | xclip -selection clipboard

Leave a comment