You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
copy to OS clipboard (needs reattach-to-user-namespace on macOS, xsel or xclip on Linux)
Will this work when I use (*for example macOS), SSH into a remote server running Linux (*debian, ubuntu or archlinux) and use tmux with this dotfile? When I try to copy texts from remote server's tmux by using C-b Enter and v -> y, I can't get texts to my local machine.
Do i need both reattach-to-user-namespace and xsel/xclip install on both machines?
The text was updated successfully, but these errors were encountered:
On one side there's the OS clipboard, and the other side there are tmux buffers.
Setting tmux_conf_copy_to_os_clipboard=true in your ~/.tmux.conf.local copy means that when you use bindings that normally save things into tmux buffers, they will also be copied into the OS clipboard. The data transfer is unidirectional, this configuration never reads from the OS clipboard.
This corresponds to the following sequence of actions, here with Vim bindings:
enter copy mode (<prefix> + Enter)
select some text (v then h, j, k, or l)
copy selection (y) ← with tmux_conf_copy_to_os_clipboard=true content goes both into tmux buffer and OS clipboard
after data entered OS clipboard, you paste it the usual way with e.g. CTRL+ V on Windows or Command + V on macOS
What I just described above requires xsel or xclip to be installed on Linux. For macOS, it depends: latest macOS versions don't need reattach-to-user-namespace anymore.
Now comes the SSH part. The master branch of my configuration doesn't address any data exchange between a remote and a local machine. But the work-in-progress os-clipboard branch does support this scenario:
SSH into a machine, where you have cloned this configuration and checked out the os-clipboard branch
launch tmux
enter copy mode (<prefix> + Enter)
select some text (v then h, j, k, or l)
copy selection (y) ← data is also copied back to the local machine through OSC 52 escape sequence
So yeah, you likely want to give the os-clipboard branch a try and report whether it works for you.
Will this work when I use (*for example macOS), SSH into a remote server running Linux (*debian, ubuntu or archlinux) and use
tmux
with this dotfile? When I try to copy texts from remote server's tmux by usingC-b Enter
andv -> y
, I can't get texts to my local machine.Do i need both
reattach-to-user-namespace
andxsel/xclip
install on both machines?The text was updated successfully, but these errors were encountered: