How do you copy from tmux (copy mode) running on a remote ssh connection to your local clipboard
This needs integrating tmux buffers with OSX clipboard. What you are trying to do with ssh host pbcopy
is just that but I don't think your setup is correct.
host
here should be your local OSX machine. And you should have password less key-based trust established between your OSX username and remote user where you are running tmux.
Step 1. Enable SSH on your OSX
Goto System preferences -> Sharing
and enable Remote Login
. Also remove administrators from the list and add your username.
Step 2. Setup password less login.
These are the steps
Step 3. Replace your host
with 192.x.x.x
or whatever your OSX's ipaddress is which is reachable from your Virtualbox
How to copy from tmux running in putty to windows clipboard
PuTTY is just a terminal emulator; the Vim registers *
and +
are concerned about the X selection and clipboard; there's no overlap.
PuTTY only allows you to copy the selected terminal contents to the Windows clipboard; when you run tmux, that will inevitably include the window layout.
You need to switch from PuTTY to something that allows real integration, like the Cygwin XWin server, which is a real X Server that integrates the X clipboard with the Windows clipboard. Instead of inside the PuTTY session, you'd ssh -X
into your server, and launch Vim in a Linux terminal, or GVIM directly. Then, yanking via "+y
will work as you'd expect.
Alternatively, if you want to keep using PuTTY, you'd have to use some workaround, like :write
ing the selection to a local file, and transferring that to Windows via scp
, for instance.
How to copy to system clipboard from tmux output after mouse selection?
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/
How to send data to local clipboard from a remote SSH session
I'm resurrecting this thread because I've been looking for the same kind of solution, and I've found one that works for me. It's a minor modification to a suggestion from OSX Daily.
In my case, I use Terminal on my local OSX machine to connect to a linux server via SSH. Like the OP, I wanted to be able to transfer small bits of text from terminal to my local clipboard, using only the keyboard.
The essence of the solution:
commandThatMakesOutput | ssh desktop pbcopy
When run in an ssh session to a remote computer, this command takes the output of commandThatMakesOutput (e.g. ls, pwd) and pipes the output to the clipboard of the local computer (the name or IP of "desktop"). In other words, it uses nested ssh: you're connected to the remote computer via one ssh session, you execute the command there, and the remote computer connects to your desktop via a different ssh session and puts the text to your clipboard.
It requires your desktop to be configured as an ssh server (which I leave to you and google). It's much easier if you've set up ssh keys to facilitate fast ssh usage, preferably using a per-session passphrase, or whatever your security needs require.
Other examples:
ls | ssh desktopIpAddress pbcopy
pwd | ssh desktopIpAddress pbcopy
For convenience, I've created a bash file to shorten the text required after the pipe:
#!/bin/bash
ssh desktop pbcopy
In my case, i'm using a specially named key
I saved it with the file name cb (my mnemonic (ClipBoard). Put the script somewhere in your path, make it executable and voila:
ls | cb
Related Topics
Generate Disk Usage Graphs/Charts with Cli Only Tools in Linux
What Are Coding Conventions for Using Floating-Point in Linux Device Drivers
How to Make Fork Changes Reflect with The Master When Updated
How to Add a Directory to The Perl Library Path at The System Level
Source Bashrc Doesn't Work in Cron
Will Java Compiled in Windows Work in Linux
How to Find List of Valid Locales in My Linux Using Perl
Difference Between Wic and Hddimg Format in Yocto
Why Can't Bash Recognize The Existence of a Socket File
Ubuntu "E: Unable to Locate Package MySQL "
Raspberry-Pi Docker Error: Standard_Init_Linux.Go:178: Exec User Process Caused "Exec Format Error"
What Happens If There Are Too Many Files Under a Single Directory in Linux
How to Find All Immediate Sub-Directories of The Current Directory on Linux