Skip to content

fix(work): Windows terminal Ctrl+C/Ctrl+V copy-paste (DAN-71) - #129

Merged
danielss-dev merged 1 commit into
mainfrom
developements/windows-terminal-clipboard-663b
Sep 16, 2026
Merged

danielss-dev merged 1 commit into
mainfrom
developements/windows-terminal-clipboard-663b

Conversation

@danielss-dev

Copy link
Copy Markdown
Owner

Summary

Windows/Linux embedded Work terminals now follow VS Code / Windows Terminal clipboard behavior:

  • Ctrl+C copies the xterm selection when one exists and does not send SIGINT.
  • Ctrl+C with no selection still forwards to the PTY (interrupt).
  • Ctrl+V pastes clipboard text through Terminal.paste.
  • Ctrl+Shift+C/V, right-click Edit menu Copy/Paste, and macOS ⌘C/⌘V are unchanged.

Implementation

Hook: xterm Terminal.attachCustomKeyEventHandler in TerminalPane (ui/src/views/Work.tsx), immediately after onData.

Decision helper: terminalClipboardAction / consumeTerminalClipboardKey in ui/src/lib/terminalClipboard.ts. Copy uses existing copyToClipboard; paste uses navigator.clipboard.readText then instance.paste.

App.tsx still does not reclaim Ctrl+C/Ctrl+V inside .work-terminal-host on Windows/Linux (only Mod+[1-8]). A comment now points at the TerminalPane handler so those keys stay terminal-owned.

Linear: DAN-71

Proof

  • pnpm --filter ./ui exec tsc --noEmit — pass
  • pnpm --filter ./ui test — 97 files / 543 tests pass, including 11 new cases in terminalClipboard.test.ts (selection copy, bare Ctrl+C forward, Ctrl+V paste, Shift variants, macOS no-claim, non-Latin KeyC/KeyV)
  • This environment is Linux and cannot run a Windows Strand / WebView2 build, so live ConPTY Ctrl+C/Ctrl+V was not exercised here.

Out of scope

Full keybinding redesign, external Open-in-terminal, WSL-only bugs.

Open in Web Open in Cursor 

Ctrl+C copies the xterm selection on Windows/Linux and still sends SIGINT
when nothing is selected. Ctrl+V pastes through Terminal.paste. macOS ⌘C/⌘V
and Ctrl+Shift+C/V stay on existing paths.

Co-authored-by: Daniels <danielss-dev@users.noreply.github.com>
@danielss-dev
danielss-dev marked this pull request as ready for review September 16, 2026 11:05
@danielss-dev
danielss-dev merged commit 3b05505 into main Sep 16, 2026
4 checks passed
@danielss-dev
danielss-dev deleted the developements/windows-terminal-clipboard-663b branch September 16, 2026 11:06
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.

2 participants