Skip to content

Instantly share code, notes, and snippets.

View issmirnov's full-sized avatar

Ivan Smirnov issmirnov

View GitHub Profile
@issmirnov
issmirnov / remote-tmux-copy-clipboard.md
Last active July 10, 2020 19:17 — forked from gengmao/gist:75e86c1d9d5427f9632d
Select text from a remote tmux session in mouse mode and copy back to Mac

Forked from: https://gist.github.com/gengmao/75e86c1d9d5427f9632d Original Author: @gengmao Minor changes by @issmirnov, specifically update config for modern tmux and add some notes.

I like to use mouse mode in tmux to scroll text in windows/panes, however I found there is problem when I wanna select and copy text into local system clipboard.

The problem is described at https://awhan.wordpress.com/2012/04/18/tmux-copy-paste-with-mouse/. The workaround is zoom tmux pane -> turn off mouse mode -> select with Option key and copy, then go back. But it is not ideal.

Fortunately I found http://seancoates.com/blogs/remote-pbcopy and https://gist.github.com/burke/5960455. I tweak them a bit and got what I want - select text in one pane in mouse mode correctly and copy it back to Mac system clipboard.