Repository navigation
fix(desktop-gpui): Ctrl editing shortcuts in text fields on Windows and Linux - #2773
Merged
Merged
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This comment has been minimized.
This comment has been minimized.
Member
Author
|
@greptileai review |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
richiemcilroy
marked this pull request as ready for review
October 22, 2026 06:21
Member
Author
|
@greptileai review |
This branch was successfully deployed
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.
![Fix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/fix-with-codesmith-light-3x.png)
What
Text fields in the GPUI desktop app now respond to the standard Ctrl editing shortcuts on Windows and Linux: Ctrl+A, Ctrl+C, Ctrl+X, Ctrl+V, Ctrl+Z, Ctrl+Shift+Z, Ctrl+Y, Ctrl+Left/Right (word motion), Ctrl+Shift+Left/Right (word selection), Ctrl+Backspace/Delete (word delete), Ctrl+Home/End (start/end of the field) and Ctrl+Shift+Home/End (select to start/end).
Why
Every chord in the
TextInputkey context is spelledcmd-*. In our gpui forkcmdparses to the platform modifier, which is the Windows key on Windows and Super on Linux (gpui/src/platform/keystroke.rs,Keystroke::parse). So on those platforms Ctrl+C, Ctrl+V and the rest did nothing inside a field, and Win+C / Super+C were the bound chords instead, which the OS usually takes first.How
text_input::bind_keysnow registerstext_input::bindings(), a plain function returning theVec<KeyBinding>, so the keymap can be unit tested without anApp.cfg!(not(target_os = "macos"))) 17 extractrl-*bindings are appended, all scoped to the sameTextInputcontext and mapped to the existing actions. No new actions, no handler changes.Behaviour per platform
TextInput, they only match while a field is focused; outside a field the keystrokes reach the same handlers as today. The editor's own Ctrl+Z project undo and other window handlers already return early while a field has focus (text_input_has_focus), so nothing that previously handled these chords inside a field is shadowed.Mouse users are unaffected: no rendering, layout or pointer code changed.
Tests
New unit tests in
ui/text_input.rs(run by the existingcargo testjobs on all three OSes):TextInputcontextManual checklist


Confidence Score: 5/5
The PR appears safe to merge; no actionable issues were found.Summary
Adds 17 Ctrl editing shortcuts for Windows and Linux without changing the macOS keymap.
Reviews (1) · Last reviewed commit: "fix(desktop-gpui): Ctrl editing shortcut..." · Reviewed by Greptile