How do you copy from tmux (copy mode) running on a remote ssh connection to your local clipboard

I am running linux through VirtualBox on OS X. I do this by starting my virtual machine in headless state and then going to the Linux machine using port forwarding. Right now, what's copied to my clipboard on my virtual machine, I can paste my remote ssh session, but not vice versa (copying from tmux copy mode). I've tried using the following tmux configurations:

setw -g mode-keys vi
bind-key -t vi-copy v begin-selection
bind-key -t vi-copy y copy-pipe "tmux save-buffer - | ssh host pbcopy"

      

Unfortunately it doesn't work ... Manual copy using the mouse works, but tmux copy mode is more convenient. Any ideas?

+3


source to share


2 answers


This requires integrating tmux buffers with the OSX clipboard. What you are trying to do with ssh host pbcopy

is just like that, but I don't think your setup is correct.

host

This should be your local OSX machine. And you must have a non-key trust based password between your OSX username and the remote user where you are using tmux.

Step 1. Enable SSH on your OSX Go to System preferences -> Sharing

and enable Remote Login

. Also remove administrators from the list and add your username.



Step 2. Setting a password less than a login.
These are the steps

Step 3. Replace host

192.x.x.x

with 192.x.x.x

or whatever your OSX IP address is accessible from your Virtualbox

+3


source


I know this question was answered, but just want to provide an alternative solution;

Copying text in tmux copy mode from remote host to local system has always been painful for me, I use a Windows laptop SSH on a remote system a lot, but apparently there was no good way to make a remote copy, especially when you have more than one screen for copy text ...



so I wrote a tool: rclip that uses the tmux copy-pipe command to copy the copied text to rclip, and rclip will send the text over the network to an rclip process running on the local system that will copy the resulting text to the system clipboard; all messages are authenticated and encrypted over TLS; give it a try, I'm quite happy with it.

0


source







All Articles