-
-
Notifications
You must be signed in to change notification settings - Fork 47
Remote Copy via OSC52
Christian Zangl edited this page Mar 25, 2021
·
4 revisions
When you run a tmux session via ssh, you can copy from the remote system to your local machine via the OSC 52 escape sequence/protocol.
Create a shell script osc52
(and chmod +x
) somewhere in your PATH
:
#!/bin/bash
printf "\033]52;c;$(base64 | tr -d '\r\n')\a"
You can test if it works with echo hello | osc52
when in a ssh session - the text should appear on your local clipboard.
Use it in extrakto with (tmux.conf
):
# allow OSC52 to set the clipboard
set -g set-clipboard on
set -g @extrakto_clip_tool_run "fg"
set -g @extrakto_clip_tool "osc52"