Make paste keyboard shortcut customizable from Preferences#125
Open
da2r-20 wants to merge 19 commits into
Open
Make paste keyboard shortcut customizable from Preferences#125da2r-20 wants to merge 19 commits into
da2r-20 wants to merge 19 commits into
Conversation
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ride Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
… handler Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Linux terminals (GNOME, Konsole, etc.) use Ctrl+Shift+V for clipboard paste since Ctrl+V is sometimes interpreted by the shell. Make that the default on Linux; macOS keeps Cmd+V and Windows keeps Ctrl+V. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pasteentry toSHORTCUT_DEFAULTSunder a newEditingcategory, surfacing it automatically in Preferences → Shortcuts. Defaults are platform-aware:Cmd+Von macOS,Ctrl+Von Windows,Ctrl+Shift+Von Linux (matches GNOME Terminal / Konsole convention soCtrl+Vnext toCtrl+Cis not a footgun in shells).before-input-eventlistener matches the configured accelerator and tells the renderer to dispatch; the renderer routes bydocument.activeElement— terminal panes get bracketed-paste-aware PTY writes; native inputs delegate towebContents.paste()for proper cursor/undo/IME.Ctrl+Vbranch fromterminal-utils.tsand thewriteToPtyargument fromattachClipboardCopyHandlerso paste no longer leaks into xterm key handlers.registerAccelerator: false(label only, no double-firing); rebuilt on startup and onpreferences-changed.Architecture
New files:
src/main/paste-accelerator.ts— owns accelerator state, parsesInputevents, installs thebefore-input-eventlistener (idempotent; resets on window close so macOS dock-reopen works).src/renderer/paste-dispatcher.ts— receivespaste:dispatch, classifies focus, routes paste.New IPC channels (preload
pastenamespace):paste:set-accelerator(renderer → main),paste:dispatch(main → renderer),paste:native(renderer → main).Design doc:
docs/superpowers/specs/2026-04-29-customizable-paste-shortcut-design.mdPlan:
docs/superpowers/plans/2026-04-29-customizable-paste-shortcut.mdTest plan
Automated (passes on this branch):
npm run buildsucceeds (main, preload, renderer)npm test— 1386 tests passmatchesPasteAccelerator, the listener install lifecycle, the focus classifier, the bracketed-paste string builder, and per-platform paste defaultsManual smoke test (Linux, completed):
Ctrl+Shift+Vpastes into a session terminal with bracketed pasteCtrl+Shift+Vpastes into a board task-modal text input (cursor + undo correct)Ctrl+Vworks in both terminal and inputs; oldCtrl+Shift+Vis suppressedKnown follow-ups
before-input-event,webContents.paste()), but a macOS reviewer should re-verify Cmd+V default + dock-icon close-and-reopen (listener resets on window close), and a Windows reviewer should specifically check no double-paste in board task-modal inputs..terminal-paneclass, soclassifyTargetroutes it as'input'→webContents.paste()rather than the bracketed-paste path. Paste still works, but via a different codepath than session terminals. Adding the class would unify the two paths.