Skip to content

Instantly share code, notes, and snippets.

@aont
Created September 14, 2025 11:16
Show Gist options
  • Select an option

  • Save aont/12dcd84b52b4d3c2ca406d58a32a4b15 to your computer and use it in GitHub Desktop.

Select an option

Save aont/12dcd84b52b4d3c2ca406d58a32a4b15 to your computer and use it in GitHub Desktop.

Enabling OSC52 Clipboard Support in tmux

If you want to copy text from tmux into your system clipboard using OSC52, you can enable it with a simple configuration change.

Step 1: Update .tmux.conf

Add the following line to your ~/.tmux.conf:

set-option -g set-clipboard on

Reload tmux with:

tmux source-file ~/.tmux.conf

Step 2: Test OSC52

Send an OSC52 sequence that encodes the string hello in base64:

echo -en "\e]52;c;aGVsbG8=\a"

If everything is configured correctly, the word hello will be copied into your system clipboard. You can confirm by pasting it into any application.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment