Skip to content

OSC 52 clipboard read

Category: extensions · Baseline: rich · Tags: Operating System Commands (OSC), Xterm Extensions · Specification ↗

OSC 52 clipboard read queries the current clipboard content. The sequence ESC ] 52 ; c ; ? BEL requests the terminal to respond with the clipboard data base64-encoded. Fewer terminals support read than write — clipboard read is a security-sensitive operation since a malicious program could silently exfiltrate clipboard contents (passwords, tokens). Terminals that support it often require explicit user opt-in.
How this is testedautomated
Set clipboard via OSC 52, then query with OSC 52;c;? BEL. Check for response containing the data.

The same probe runs against headless backends (via Termless) and real terminal apps (via a daemon launched in each terminal). This lets us distinguish parser correctness from rendering correctness.

Analysis2026-04-06

Supported by 6 of 12 terminals (50%). Part of the Rich TUI baseline. Notes: Kitty: OSC 52 clipboard read not exposed via Python batch bridge; vt100.js: Not implemented — pure TypeScript emulator; xterm.js: OSC 52 clipboard read not implemented in xterm.js.

Supported by 5 of 14 backends (36%)

Terminal Applications

TerminalVersionSupportNotes
iTerm23.6.9✓ yes
VS Code✓ yes
Cursor✓ yes
Ghostty1.3.1✗ noNo OSC 52 read response
Warp✗ no
Terminal.app✗ no

Headless Backends

Parser correctness only — a means the parser accepts the sequence.

BackendVersionSupportNotes
vterm0.2.0✓ yes
Alacritty0.26.0~ partialOSC 52 clipboard read not exposed in headless mode
Kitty0.40.0~ partialOSC 52 clipboard read not exposed via Python batch bridge
WezTerm0.1.0-fork.5~ partialOSC 52 clipboard read not exposed in headless mode
vt100.js0.2.1✗ noNot implemented — pure TypeScript emulator
xterm.js5.5.0✗ noOSC 52 clipboard read not implemented in xterm.js