Cross platform clipboard.
Both remote and local
Works out of the
Works the same locally as over SSH, inside Docker containers, et al.
It even works inside Docker over SSH and then inside Docker!, infinitely chainable.
isomorphic-cp communicates by
unix socket only!
All it does is spawn subprocesses and listen to
This makes it amazingly versatile.
You literally just run
cssh <ssh-args> or
No local daemon required. The remote "daemon" is just a subprocess of a subprocess. Zero cost when you are not using it.
How to use
wl-clipboard under GUI linux.
Clone this repo to the same location on two machines. Either relative to
isomorphic-copy/bin to your
PATH for example:
export PATH="$XDG_CONFIG_HOME/isomorphic-copy/bin:$PATH" in your
You need to do this on both local and remote.
Automatically most applications that use
pbcopy and so forth will use
isomorphic-copy with zero setup.
Works just like python
I added two convenience functions:
You don't have to use these. Things like
pbpaste will continue to work.
echo <my message> | c Use
c to copy to system clipboard
p > my_message.txt Use
p to paste from system clipboard
Connect to remote with one of
cdocker <docker container name>
Once daemon is launched, remote copy will propagate to local system clipboard.
Remote applications that use
wl-copy will propagate to local system clipboard.
Local -> SSH -> Docker
If you want to copy from a
Docker container on a remote machine.
from local run
cssh <ssh-args> to remote
from remote run
cdocker <container name / sha> to container
And you are set!
Copy will automatically propagate to local / remote tmux clipboard.
If daemon is run under tmux, copy will also propagate to the local tmux clipboard.
If no system clipboard is available, copy / paste will use tmux clipboard.
Copying FROM tmux will require this snippet.
set -g mouse on bind -T copy-mode MouseDragEnd1Pane \ send-keys -X stop-selection bind -T copy-mode MouseDown1Pane \ select-pane \;\ send-keys -X copy-pipe "c" \;\ send-keys -X clear-selection
Drag to select, click in dragged area to copy.
copy-mode-vi if you are using vi emulation.
Neovim will only use
xclip if the x11 environmental variable
DISPLAY is set.
Vim will require an autocmd event.
Add this snippet to your
vimrc, to work for both vims.
if has('nvim') " use unnamedplus only! or else will double set set clipboard=unnamedplus if getenv('DISPLAY') == v:null exe setenv('DISPLAY', 'FAKE') endif else autocmd TextYankPost * call system("c", getreg('"')) endif
Most CLI applications will work out of the box. (such as lazygit, for example).
If not, check if they require
DISPLAY like Neovim.
If no system / tmux clipboard is found, setting environmental variable
ISOCP_USE_FILE=1 will enable using a temp file as a crude clipboard.
It will write inside the git repo, put it somewhere safe.