fix(terminal): restore CTRL+V paste on Windows and context menus - #6272
fix(terminal): restore CTRL+V paste on Windows and context menus#6272WarheadTaylor wants to merge 2 commits into
Conversation
- Enable native Paste for canvas terminals - Support Ctrl+V on Windows and position the hidden input for context menus
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cf0073ef03
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const bounds = this.mount.getBoundingClientRect(); | ||
| const left = event.clientX - bounds.left - CONTEXT_MENU_INPUT_SIZE / 2; | ||
| const top = event.clientY - bounds.top - CONTEXT_MENU_INPUT_SIZE / 2; |
There was a problem hiding this comment.
Implement context-menu paste for browser clients
In the web and locally hosted browser clients, the native context menu remains associated with the canvas that received this contextmenu event; moving and focusing a textarea after dispatch does not change that event target or its non-editable menu state. Unlike desktop, where DesktopWindow.ts explicitly enables Electron's Paste role for canvases, these clients will therefore still show Paste as unavailable. Use a renderer-owned context-menu action or another clipboard path that does not depend on changing the hit-tested element after the event.
AGENTS.md reference: AGENTS.md:L67-L70
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit cf0073e. Configure here.
ApprovabilityVerdict: Needs human review This bug fix modifies runtime paste behavior and DOM manipulation for context menus. An open review comment raises a valid concern that the fix may only work for Electron/desktop, not browser clients - this incomplete coverage warrants human review to confirm the scope is intentional. You can customize Macroscope's approvability policy. Learn more. |

What Changed
Why
CTRL+Shift+V worked on Windows, but it wasn't surfaced to the user that it was the expected input for pasting. This PR expands the different methods available.
Checklist
Note
Low Risk
Input/UX paste handling only; no auth, security, or data-path changes.
Overview
Makes terminal paste work via Ctrl+V on Windows and via the native/Electron context menu.
isTerminalPasteShortcutnow accepts bothCtrl+VandCtrl+Shift+Von Windows; Linux staysCtrl+Shift+V-only and macOS staysCmd+V.On right-click, the hidden textarea is briefly moved under the cursor and focused so Paste targets the terminal input, then restored. The desktop Electron menu also enables Paste over
canvaselements, since Electron treats the terminal canvas as non-editable.Reviewed by Cursor Bugbot for commit 3dae294. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Fix CTRL+V paste in the terminal on Windows and in context menus
isTerminalPasteShortcutinsurface.tsnow treats both Ctrl+V and Ctrl+Shift+V as paste shortcuts; Linux keeps only Ctrl+Shift+V; macOS keeps Cmd+V.DesktopWindow.tsis now enabled whenparams.mediaTypeis"canvas", not just wheneditFlags.canPasteis true.preventDefaultto avoid unintended textarea repositioning.Macroscope summarized 3dae294.