Skip to content

fix(app): ask before programs set the clipboard with OSC 52 - #28

Merged
arifintahu merged 1 commit into
mainfrom
fix/osc52-clipboard
Oct 28, 2026
Merged

arifintahu merged 1 commit into
mainfrom
fix/osc52-clipboard

Conversation

@arifintahu

Copy link
Copy Markdown
Member

What and why

Any terminal output could silently replace the clipboard with an OSC 52 write (for example a file shown with cat, or a remote host), so the next paste ran attacker text.

  • New setting Settings → Terminal → Let programs set the clipboard (behavior.osc52_clipboard), off by default
  • While off, OSC 52 is ignored and one toast per pane explains how to allow it
  • While on, a toast says how many characters a program copied
  • Payloads over 100,000 bytes are refused either way

Behavior change: tmux/vim/ssh clipboard sync through OSC 52 stops working until the user turns the setting on. This goes in the changelog.

Fixes #18

How you checked it

  • Tests first: the size cap in osc.test.ts, and the config default (including an old config without the key) in config_test.rs.
  • cargo fmt --check, cargo clippy --all-targets -- -D warnings, cargo test (88), pnpm turbo check test (148 app tests, 0 svelte-check errors), pnpm version:check pass.
  • Not tested: the toggle and toasts in the running app (my own EmberTerm was open). Please try printf '\e]52;c;aGVsbG8=\a' with the setting off and on.

@arifintahu
arifintahu merged commit 799e3d7 into main Oct 28, 2026
@arifintahu
arifintahu deleted the fix/osc52-clipboard branch October 28, 2026 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(app): OSC 52 silently overwrites the clipboard

1 participant