Files
orca/src
NeilandOrcaWin e3f44dc2f9 fix: verify terminal clipboard writes so success never lies (#5611)
Terminal copy paths (Ctrl+Shift+C, right-click, context-menu copy,
copy-on-select, and OSC 52) wrote to the clipboard via
window.api.ui.writeClipboardText but swallowed write failures and never
checked that the OS clipboard actually changed. The main-process
clipboard:writeText handler called clipboard.writeText() and returned
without reading back, so a stale OS clipboard (Electron returns without
throwing even when the write did not land, seen on Windows with Copilot
conversation text) looked like success while the clipboard was unchanged.

- clipboard-ipc-handlers.ts: after the existing trusted-sender auth and
  text-size-limit checks, write then read back the standard clipboard and
  throw on mismatch. The X11 PRIMARY "selection" clipboard is deliberately
  not verified, since ownership can pass to another app and a read-back
  would surface false failures on Linux primary-selection copies.
- terminal-selection-copy.ts: shared helper so every renderer copy path
  propagates a write rejection instead of silently claiming success, and
  only clears the xterm selection after the write resolves.
- osc52-clipboard.ts: add onWriteFailure so a TUI yank that never reaches
  the host clipboard surfaces a toast instead of a silent no-op.
- osc52-clipboard-blocked-toast.ts: add showOsc52ClipboardFailedToast.

Supersedes community PR #5634.

Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
2026-06-27 23:29:02 -07:00
..