Copy text from remote via iTerm2 with Tmux to OS X clipboard
This app might solve your problem, clipper.
I came across this software sometime earlier, but I have never used it. It has a screencast and it seems just to fit your need exactly.
Related videos on Youtube
resting
Updated on September 18, 2022Comments
-
resting over 1 year
I'd tried using iTerm2 beta Build 1.0.0.20120724 and using
bind C-y run-shell "reattach-to-user-namespace -l zsh -c 'tmux show-buffer | pbcopy'"
in .tmux.conf but none works.The solutions I found aren't specific about the system and conditions. Hence I hope the problem statement here is clear ie. Copying text from remote to OS X clipboard via iTerm2 with Tmux.
Problem:
Copy text output from cat of a log file that's longer than a screen.
Copy text from vertically* split screen (left and right panes) without copying the text from the other pane.
*not sure if it should be called vertically or horizontally split.Copy text through Vim that's longer than a screen.
I'm aware of holding alt while clicking and drag to select the text. But the problem arises when you need to scroll, or are working in more than 1 pane.
-
chepner over 11 yearsWhen you say "remote", do you mean you are running
tmux
on the remote side of anssh
connection? -
Paulo Almeida almost 11 yearsautomizu's answer may be exactly what you need, but I'll refer you to my own answer on unix stackexchange. In addition to that, you would probably want tmux's
save-buffer
command.
-
Jan Doggen almost 10 yearsPlease explain 'in some cases'
-
holmberd almost 5 yearsWith some cases he probably means where you have a direct connection the the target machine and are able to reverse ssh the pbcopy command. In that scenario this works.