Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to copy to system clipboard from tmux output after mouse selection?

Now for copy to system clipboard I have to select via mouse text in tmux window with Shift key. And then I have to run this command:

tmux save-buffer - | reattach-to-user-namespace pbcopy 

Is any chance to save to system clipboard easier? Key bind or better do that automatically after Shift release.

My tmux config: https://gist.github.com/3641580

like image 913
tomekfranek Avatar asked Sep 05 '12 18:09

tomekfranek


People also ask

How do I copy text from a tmux session?

Use the 'Ctrl+spacebar' to start copying. Step 3. Move with the arrow keys to the position of the text you want to copy to. When you have finished selecting the text, press 'Alt+w' or 'Ctrl+w' to copy the text to a Tmux Buffer.

How do I save my tmux output?

In order to save an entire tmux session, type prefix + Control + s .

How do I scroll and copy in tmux?

copy-mode is the way to view history (and optionally copy stuff out of it). Just run: echo "set -g mouse on" >> ~/. tmux. conf and you'll be able to scroll.


1 Answers

If you are using iTerm2, you can copy text in Tmux session, holding down the Option key while dragging the mouse to make selection.

Then it should be possible to paste text anywhere with Cmd + V as usual. Found it here: http://web.archive.org/web/20131226003700/http://ootput.wordpress.com/2013/08/02/copy-and-paste-in-tmux-with-mouse/

like image 194
Rolands Bondars Avatar answered Oct 03 '22 23:10

Rolands Bondars