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

tomekfranek picture tomekfranek · Sep 5, 2012 · Viewed 58k times · Source

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

Answer

Rolands Bondars picture Rolands Bondars · Nov 7, 2013

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/