OSC 52

25年 2月 6日 Thursday
155 words
1 minutes

NOTICE:

I use terms remote and local to refer remote server and local computer that access the server

make sure your terminal which is used to run ssh is support osc 52 (st by default disable this functionality, see references) and put the following tmux config on the remote server:

text
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "tmux save-buffer - | base64 | tr -d '\n' | printf '\033]52;c;%s\007' $(cat -)"

apply the changes by tmux source ~/.tmux.conf.

and on your local config, check tmux show -s set-clipboard and make sure the output is not 'off', see the man page.

text
tmux info|grep Ms

references:

Title:OSC 52

Author:ReYuki

Link:https://www.reyuki.site/posts/osc-52 [copy]

Last updated:


This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. You are free to share and adapt it, as long as you give appropriate credit, don’t use it for commercial purposes, and distribute your contributions under the same license. Provided under license CC BY-NC-SA 4.0