Skip to content

Fix macOS Option+key sending wrong codepoint in Kitty keyboard protocol#5794

Merged
anthonykim1 merged 3 commits intoxtermjs:masterfrom
anthonykim1:anthonykim1/optionFBKitty
Apr 6, 2026
Merged

Fix macOS Option+key sending wrong codepoint in Kitty keyboard protocol#5794
anthonykim1 merged 3 commits intoxtermjs:masterfrom
anthonykim1:anthonykim1/optionFBKitty

Conversation

@anthonykim1
Copy link
Copy Markdown
Member

microsoft/vscode#304765

On MacOS with macOptionIsMeta to true, and when application enables KKP, option+letter key seem to send wrong codepoint.

Option+F sends \x1b[402;3u (ƒ) instead of \x1b[102;3u (f), breaking word navigation in apps like claude code, copilot cli.

I think the encoder already dervie base key from ev.code for Shift.
Matching macOptionAsAlt similar to Kitty --> https://github.com/kovidgoyal/kitty/blob/281cff0b604735407e1ffbee439086c8780b2f65/kitty/options/definition.py#L2625-L2639

@anthonykim1 anthonykim1 added this to the 7.0.0 milestone Apr 3, 2026
@anthonykim1 anthonykim1 self-assigned this Apr 3, 2026
@anthonykim1 anthonykim1 marked this pull request as ready for review April 6, 2026 05:49
@anthonykim1 anthonykim1 requested a review from Tyriar April 6, 2026 05:49
@anthonykim1 anthonykim1 merged commit 34e0179 into xtermjs:master Apr 6, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant