Skip to content

Remote Copy via OSC52

Christian Zangl edited this page Mar 23, 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

set -g @extrakto_clip_tool_run "fg"
set -g @extrakto_clip_tool "osc52"
Clone this wiki locally