-
Notifications
You must be signed in to change notification settings - Fork 10.1k
feat: Support Alt+key combinations #10767
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
jacob314
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks generally good. Some of these comments are mainly questions. For keyboard support we have to be extremely careful and do absolutely the minimum rather than letting the logic get too complex.
…al-keys.txt with: - 4 terminals (iTerm2, Ghostty, MacTerminal, VSCodeTerminal) - 3 keys (a, o, m) with Alt modifier Fixed the implementation - Updated KeypressContext.tsx to handle Alt+letter in kitty protocol by changing one condition from ctrl && to (ctrl || alt)
838b5f6 to
5fec551
Compare
- Add comprehensive map for all Alt+A through Alt+Z combinations - Convert accented characters (å, ø, µ, ¥, etc.) to proper Alt+letter events - Fix Alt+Y handling for both backslash (\) and yen (¥) symbols
| // Map of accented characters to their corresponding Alt+letter combinations | ||
| // These are sent by iTerm2/VSCode terminals when pressing Alt+letter, but with meta:false | ||
| const ACCENTED_CHAR_TO_LETTER: Record<string, string> = { | ||
| å: 'a', // Alt+A |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove these comments. and rename this to alt or meta key map rather than accented char to letter. That way the name describes what this is not what it looks like.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
jacob314
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved after this last minor nit is addressed.
…ose as a mapping of Alt key characters.
| π: 'p', | ||
| œ: 'q', | ||
| '®': 'r', | ||
| ß: 's', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why aren't some of these chars in quotes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prettier seems to be removing the single code for some unicode characters so using Unicode escape codes
jacob314
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enhanced keyboard input processing to support:
Added comprehensive test coverage for all new keyboard input scenarios
fixes: #10753
TLDR
Dive Deeper
Reviewer Test Plan
Testing Matrix
Linked issues / bugs