fix(text_field): alias Meta modifier to Ctrl for Cmd+A/C/V/X#92
Open
KoalaHao wants to merge 1 commit into
Open
fix(text_field): alias Meta modifier to Ctrl for Cmd+A/C/V/X#92KoalaHao wants to merge 1 commit into
KoalaHao wants to merge 1 commit into
Conversation
Cherry-picked from dddf6ac (marsup-space main) onto upstream main as a standalone change. PR Norbert515#90 (kitty 4-part IME) does not touch the Cmd+key path, but the user's expectation that Cmd+C works like on macOS GUI is independent and equally broken on stock nocterm — so this belongs in its own PR. On the kitty keyboard protocol the macOS Cmd key arrives as a super/Meta modifier, so Cmd+A/C/V/X reached TextField with meta=true and fell through to the character-insertion branch — typing a literal 'a' / 'c' / 'v' / 'x' into the field instead of selecting / copying / cutting / pasting. macOS GUI users expect Cmd to be the platform modifier for clipboard/selection just like Ctrl is on Linux/Windows. Accept either ctrl: true or meta: true on the select-all, copy, cut, and paste handlers. Cmd+W and Cmd+T are intentionally NOT aliased because macOS already uses those for 'close window' / 'new tab'; they must keep falling through. Pairs with the meta-A regression guard: Ctrl+C still bubbles up to the app quit handler (unchanged). Adds test/components/text_field_meta_keybindings_test.dart with 6 cases: Cmd+A selects, Cmd+C doesn't insert 'c', Cmd+V doesn't insert 'v', Cmd+X doesn't insert 'x', Cmd+W is NOT delete-word, Cmd+T is NOT transpose.
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.
On the kitty keyboard protocol the macOS Cmd key arrives as a
super/Meta modifier, so
Cmd+A/C/V/XreachedTextFieldwithmeta: trueand fell through to the character-insertion branch,typing a literal
a/c/v/xinto the field instead ofselecting / copying / cutting / pasting. macOS GUI users expect
Cmd to be the platform modifier for clipboard/selection just like
Ctrl is on Linux/Windows.
Accept either
ctrl: trueormeta: trueon the select-all,copy, cut, and paste handlers.
Cmd+WandCmd+Tareintentionally NOT aliased — those keep their macOS conventions
(close window / new tab) and must keep falling through.
This is orthogonal to PR #90 (kitty 4-part IME associated text);
both are valuable but neither supersedes the other. The Cmd
keybinding here is purely about the kitty 2-/3-part form
that iTerm2 / WezTerm / Ghostty / Kitty emit on every
Cmd+A/C/V/Xpress, regardless of any IME context.Tests:
Cmd+Aextends the selection (alias for Ctrl+A)Cmd+Cdoes NOT insert a literal 'c' (paste path is taken)Cmd+Vdoes NOT insert a literal 'v'Cmd+Xdoes NOT insert a literal 'x'Cmd+Wis NOT delete-word (macOS close-window convention)Cmd+Tis NOT transpose (macOS new-tab convention)Ctrl+Cstill bubbles up to the app quit handler