Remote Copy via OSC52 - laktak/extrakto Wiki

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:

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"