Repository navigation
fix: resolve JIS keyboard bracket and backslash shortcut mapping - #2624
Merged
Jinwoo-H merged 2 commits intoMay 22, 2026
Merged
Conversation
JIS keyboards emit different event.code for bracket keys compared to US layouts. BracketRight is emitted for '[', and Backslash for ']'. This commit updates the keybinding matcher to also evaluate the 'key' property to reliably identify brackets and backslash across different keyboard layouts.
- centralize semantic bracket/backslash matching for international layouts - preserve physical-code fallback when key text is inconclusive - avoid stealing AltGr bracket input on Windows/Linux - expand regression coverage for tab, pane, and fallback behavior Co-authored-by: Orca <[email protected]>
Contributor
|
Thank you @octu0 ! |
Contributor
Author
|
😃 |
5 tasks done
enrick-dev
pushed a commit
to enrick-dev/orca
that referenced
this pull request
Oct 15, 2026
…blyai#2624) Fix JIS bracket/backslash shortcut intent matching across tab and terminal-pane shortcuts.\n\nReview follow-up:\n- centralize semantic punctuation matching for bracket/backslash keys\n- preserve physical-code fallback when key text is inconclusive\n- avoid stealing AltGr bracket input on Windows/Linux\n- add regression coverage for JIS, AltGr, and fallback behavior
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.
Note
Please note that since English is not my native language, the text below was generated using AI translation.
If there is anything you don't understand, please let me know and I will clarify.
Summary
Fixes an issue where bracket shortcuts (
Cmd+Shift+[andCmd+Shift+]) do not work correctly on JIS (Japanese) keyboard layouts, specifically when attempting to switch tabs or split panes.Problem:
On a JIS keyboard, the physical keys for
[and]emit differentKeyboardEvent.codevalues compared to a US QWERTY layout:[emitsBracketRight]emitsBackslashBecause the keybinding matcher in
src/shared/keybindings.tsrelied strictly onevent.codeto resolveBracketLeft,BracketRight, andBackslash, JIS users pressingCmd+Shift+[were triggering theBracketRightaction (Next Tab), and pressingCmd+Shift+]was triggeringBackslash(which resulted in a no-op or unintended behavior).Solution:
Updated the keybinding resolution logic in
src/shared/keybindings.tsto also evaluate theevent.keyproperty when dealing with brackets and backslashes. By checking the actual character inputted ([,{,],},\,|), we can reliably determine the user's intent across international keyboard layouts, while still falling back toevent.codefor physical position mapping.Screenshots
No visual change.
Testing
pnpm lintpnpm typecheckpnpm testpnpm buildsrc/shared/keybindings.test.tsto verify JIS shifted key combinations correctly map to the expected bracket actions and do not falsely trigger backslash/opposite brackets.AI Review Report
The AI agent reviewed the keyboard shortcut matching logic. The main risk checked was ensuring that fallback checks on the
event.keyproperty would not inadvertently break US/UK layouts or create cross-platform conflicts.event.keychecks strictly scopes to characters outputted by those specific keys.if (key === ']' || key === '}') { return false }insideBracketLeft) to ensure that if a JIS layout emitsBracketRightfor the[key, it doesn't accidentally trigger both shortcuts simultaneously.Security Audit
No security implications. This PR only modifies local keyboard event matching logic in the shared layer. No IPC boundary changes, no command execution, and no dependency changes.
Notes
AltGrcombinations to type brackets.