fix(web): copy terminal selection with Ctrl+Insert - #8541
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe terminal recognizes Ctrl+Insert as a copy shortcut on non-macOS platforms. The keydown handler synthesizes the copy command, and tests cover supported and rejected key combinations. ChangesTerminal copy shortcut
Priority: ➖ Normal — Impact reflects medium issue severity. Estimated code review effort: 2 (Simple) | ~10 minutes Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to Terminal users on non-macOS platforms can copy selected text with Ctrl+Insert without sending the chord to the PTY, while existing macOS behavior remains unchanged. No current merge-readiness risk remains. Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a narrowly scoped terminal shortcut fix: non-macOS Ctrl+Insert now copies an existing selection through the established copy path, while existing shortcuts and macOS behavior remain unchanged. Regression tests cover the new and excluded cases, with no schema, infrastructure, or sensitive-area changes. You can add or adjust custom eligibility rules. Learn more. |
c9b54bb to
3f0b9ca
Compare
Bugbot is paused — on-demand spend limit reachedBugbot uses usage-based billing for this team and has hit its on-demand spend limit. A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue. |
Bugbot is paused — on-demand spend limit reachedBugbot uses usage-based billing for this team and has hit its on-demand spend limit. A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue. |
SunkenInTime
left a comment
There was a problem hiding this comment.
Windows review of a6b41c0177fbb25e793dd8284def7d31dee090f4, compared with 6df0add6e65b7c0040b5774635f794e4ff802ddd.
No blocking defect found in the Ctrl+Insert change. All 49 focused surface tests pass, as do format/lint for the two changed files and the web typecheck. Bun is absent on this machine; I used the checkout's pinned Vite+ 0.3.0 tooling and scoped checks.
In the real T3 app on Windows build 26200 / Chrome 152, a synthetic Ctrl+Insert keydown ran the terminal handler, emitted a trusted copy event through execCommand, and copied the selected text to the Windows OS clipboard. Repeated copy retained the selection. Without a selection, the clipboard stayed unchanged. Ctrl+Shift+C also copied; the Ctrl+C and Shift+Insert clipboard fallback checks behaved as expected within the browser bridge.
This is a comment rather than approval because physical-key and Electron testing remain incomplete. The browser shortcut tool substitutes a copy event for Ctrl+Insert, so its initial apparent success was discarded as keydown evidence. Please do a physical-key smoke test in Windows Chrome and Electron before treating this as a complete Windows sign-off.
- P2, baseline only: closing the test terminal removed it from the UI but left its shell running.
Manager.ts:1620sends SIGTERM throughNodePtyAdapter.ts:90; node-pty rejects signals on Windows. I reproduced the dependency behavior separately and verified those files and the lockfile are unchanged from the base. This belongs in separate work and is not a blocker for this PR. Owned test processes were cleaned up.
Windows review report · Evidence and reproduction bundle
Reviewed by GPT-6 through Codex.
Shift+Insert already pastes. Ctrl+Insert currently falls through because isTerminalCopyShortcut only matches the C key.
Mirror the Shift+Insert paste branch. Ctrl+Insert is the GTK/VTE copy chord and the one tiling WMs send for universal clipboard on a terminal window. Copy only, do not treat it as SIGINT. Closes pingdotgg#8525
a6b41c0 to
b0b9776
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
## What's Changed * feat(chat): attach files to question answers by @shivamhwp in pingdotgg/t3code#9871 * feat(desktop): refresh macOS installer with aurora artwork by @saphid in pingdotgg/t3code#10632 * fix(server): give completed turns a full session idle window by @StiensWout in pingdotgg/t3code#10689 * feat(web): add pull request merge defaults by @Bil0000 in pingdotgg/t3code#8088 * fix(usage): keep account columns aligned across limit rows by @juliusmarminge in pingdotgg/t3code#10690 * fix(web): chat text no longer shows through a 1px gap under composer banners by @vitalyiegorov in pingdotgg/t3code#10635 * refactor(server): classify runtime exports by @juliusmarminge in pingdotgg/t3code#10274 * refactor(server): classify orchestration exports by @juliusmarminge in pingdotgg/t3code#10275 * refactor(server): classify service exports by @juliusmarminge in pingdotgg/t3code#10276 * refactor(server): classify telemetry exports by @juliusmarminge in pingdotgg/t3code#10277 * refactor(server): classify provider exports by @juliusmarminge in pingdotgg/t3code#10278 * refactor(server): classify source control exports by @juliusmarminge in pingdotgg/t3code#10279 * refactor(server): classify source control registry API by @juliusmarminge in pingdotgg/t3code#10280 * refactor(server): classify preview toolkit exports by @juliusmarminge in pingdotgg/t3code#10281 * ci(knip): enforce server exports by @juliusmarminge in pingdotgg/t3code#10282 * feat(web): add previous/next turn navigation in minimap by @UtkarshUsername in pingdotgg/t3code#8531 * fix(web): stop the settings sidebar shifting when switching pages by @t3dotgg in pingdotgg/t3code#10705 * fix(web): copy terminal selection with Ctrl+Insert by @iamshadmantaqi in pingdotgg/t3code#8541 * fix(web): show the same project icon in the command palette as everywhere else by @t3dotgg in pingdotgg/t3code#10712 * fix(web): stop sidebar rows flashing and shifting on click by @t3dotgg in pingdotgg/t3code#10713 * refactor(web): pass the project record to ProjectFavicon so icons cannot drift by @t3dotgg in pingdotgg/t3code#10714 ## New Contributors * @iamshadmantaqi made their first contribution in pingdotgg/t3code#8541 **Full Changelog**: pingdotgg/t3code@v0.0.41-nightly.20260908.1387...v0.0.41-nightly.20260908.1400 Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.41-nightly.20260908.1400
What Changed
isTerminalCopyShortcutnow treatsCtrl+Insertas copy on non-mac platforms, matching the existingShift+Insertpaste branch. The keydown handler copies withexecCommand("copy")the same way it does forCtrl+Shift+C, so the chord does not go to the PTY and is not treated as SIGINT.Why
Tiling WMs such as Omarchy map universal copy on a terminal window to
Ctrl+Insert. Paste already worked because #5982 addedShift+Insert. Copy still requiredkey === "c", so the selection never reached the clipboard.Ctrl+Insertis also the usual GTK/VTE copy chord.Closes #8525
Blast Radius
Web and desktop share
GhosttyTerminalSurface. Mobile does not use this helper.Ctrl+CandCtrl+Shift+Care unchanged. macOS still ignores Insert for this shortcut.Verification
Failing-then-passing regression in
apps/web/src/terminal/ghostty/surface.test.ts.vp test run apps/web/src/terminal/ghostty/surface.test.tsfailed withexpected false to be trueonCtrl+Insert.vp linton the two changed files: 0 errors.vp run --filter @t3tools/web typecheck: clean.No UI chrome changed, so no screenshots.
Checklist
Note
Low Risk
Scoped keyboard shortcut and clipboard copy path in the Ghostty terminal surface; existing Ctrl+C and macOS behavior stay unchanged.
Overview
Non-mac Ghostty terminal copy now treats Ctrl+Insert like other copy chords when text is selected, alongside existing Ctrl+C / Cmd+C behavior.
isTerminalCopyShortcutadds an Insert branch (Ctrl, no Shift/Meta) on non-mac platforms, mirroring how Shift+Insert is handled for paste. The surface keydown path runsexecCommand("copy")for Insert as well as Ctrl+Shift+C, because the browser does not fire a native copy event for those chords—so the selection is primed and copied without sending the key to the PTY or triggering SIGINT semantics tied to plain Ctrl+C.Regression tests cover Linux acceptance and macOS rejection of Ctrl+Insert.
Reviewed by Cursor Bugbot for commit c9b54bb. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add
Ctrl+Insertcopy shortcut to terminal on non-mac platformsisTerminalCopyShortcutin surface.ts to return true for theInsertkey on non-mac platforms whenCtrlis pressed and neitherShiftnorMetaare held.keydownhandler soCtrl+Inserttriggers the synthesized copy path (document.execCommand('copy')) and callspreventDefault, matching the existingCtrl+Shift+Cbehavior.Ctrl+Insert, andShift+Insert/Meta+Insertare not treated as copy on any platform.Macroscope summarized 3f0b9ca.
Summary by CodeRabbit
New Features
Bug Fixes