Repository navigation
Enable Option shortcuts for ABC keyboards in Auto mode - #24528
Conversation
|
| {translate( | ||
| 'settings.terminal.optionShortcutHint', | ||
| 'If Option shortcuts type symbols, choose Left, Right, or Both. Left or Right keeps the other Option key available for accents and symbols.' |
There was a problem hiding this comment.
Guidance is missing from search The new hint tells users about Option shortcuts typing symbols and keeping a key available for accents, but the setting’s search entry still uses its older description and keywords. Searching settings for “symbols” or “accents” therefore does not find this control. Add those terms to its search entry.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| 'settings.terminal.optionLayoutCompose', | ||
| 'layout uses Option to compose characters like @, €, [, ]' |
There was a problem hiding this comment.
Detected layout label reads awkwardly On a composing layout, Auto now displays “Auto — detected: layout uses Option to compose characters…”. The replacement no longer names the detected layout category, making the result harder to understand. Use a clear category phrase here and in its translations.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (9)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe terminal settings now use translated labels for detected Option-key layouts and append translated guidance about choosing Left, Right, or Both for shortcuts. English, Spanish, French, Japanese, Korean, and Chinese translations were added. New unit and end-to-end tests cover punctuation input across Option modes, keyboard flags, key sides, and layout characters. Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to This change improves the Option-as-Alt setting text across supported languages and adds test coverage. No merge-blocking risk was found. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 3 files. (6 skipped: 6 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
ℹ️ Minor suggestions only — nothing blocking.
Reviewed changes
- Terminal settings copy —
TerminalMacKeyboardSection.tsxlocalizes the three detected-layout labels under newsettings.terminal.*keys, removes the "non-US layout" wording, and appends the Option split-side hint to the row description. - Option punctuation unit coverage — new
terminal-option-punctuation.test.tspinsresolveTerminalOptionShortcutActionand the kitty release tracker across Alt modes, repeats/releases, legacy escape bytes, IME ownership, non-Mac input, and active-layout encoding. - Option punctuation E2E coverage —
terminal-option-composed-ascii.spec.tsgains side-aware synthetic dispatch and three macOS specs driving the settings control, CDP Chromium punctuation, and legacy kitty bytes. - Locale catalogs — new keys added to all six locales; Chinese
Rightcorrected from正确的to右边.
The unit expectations match the real policy and release-tracker branches, the E2E byte expectations line up with encodeTerminalOptionKittyEvent output, and the new English entries are prunable against their call-site fallbacks so the runtime-required catalog needs no regeneration.
ℹ️ Nitpicks
en.jsonsettings.terminal.optionLayoutComposerenders as "Auto — detected: layout uses Option to compose characters like @, €, [, ]". Adding an article ("this layout uses Option…") would match the noun-phrase form of the other two detected labels and read more cleanly.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
| "1c337bef4a": "控制按 JIS 日元 (¥) 键是否发送反斜杠 (\\\\)。", | ||
| "3fe1c5bfe0": "关", | ||
| "c73d510938": "正确的", | ||
| "c73d510938": "右边", |
There was a problem hiding this comment.
This corrects a genuine mistranslation (Right was rendered as 正确的, "correct"), and the repo already guards this class of fix against bootstrap re-translation in zh-technical-literal-mistranslations.test.ts. Consider adding an assertion there (expect(findByKey(zh, 'c73d510938')).toBe('右边')) so it cannot silently regress.
| // ABC and US share the standard layout; international variants retain Option composition. | ||
| const META_INPUT_SOURCE_IDS: readonly string[] = [ | ||
| 'com.apple.keylayout.us', | ||
| 'com.apple.keylayout.abc' |
There was a problem hiding this comment.
There was a problem hiding this comment.
ℹ️ No new issues found in the new commit. Not approving only because the earlier non-blocking zh regression-guard thread is still open.
Reviewed changes
Incremental re-review of the production-behavior commit 56f951ec since the prior pullfrog review at d82e555.
- ABC reclassified as standard —
input-source-id.tsallowlistscom.apple.keylayout.abcbeside.us, so Auto enables Option-as-Meta for ABC while every other layout (ABC Extended, US Extended, US-International-PC, Polish Pro, IMEs) keeps composing. - Main-process probe prefers the selected source —
readSelectedInputSourceFromJson/readKeyboardInputSourceIdnow return a taggedinputSourcevskeyboardLayout, prefer an active IME over its US-shaped backing layout, readAppleCurrentKeyboardLayoutInputSourceIDonly when no input-mode record exists, and return no signal on probe failure instead of blindly falling back. - Renderer probe stays conservative on macOS — the probe short-circuits to
unknownwhenever native identity is missing on macOS, disabling the US-fingerprint fallback there; non-Mac still uses the fingerprint. - Settings copy, locales, and E2E helpers —
optionLayoutAltnow reads "ABC or U.S.", the split-side hint is reworded, all six catalogs were updated, and the Option-key E2E helpers were extracted intoterminal-option-key-input.tswith a new Auto ABC/IME/side spec.
The allowlist and parser branches line up with real AppleSelectedInputSources dumps (which mirror the active source, so an active IME surfaces as an Input Mode record rather than its ABC backing layout), and the changed English strings still match their call-site fallbacks so en-runtime-required needs no regeneration.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

ELI5
With Auto on an ABC keyboard, Option+. now reaches the terminal application as a shortcut instead of typing ≥. The default setting stays Auto. Off still types accents and symbols; Left or Right reserves one Option key for each use.
What Changed
Auto now treats the exact macOS ABC input-source ID like the existing U.S. ID. Extended, international, custom, and IME sources still compose characters. Explicit Both, Off, Left, and Right settings take precedence, including in terminals already open when the input source changes.
If macOS cannot identify the active source, Auto keeps composition. The preference fallback reads the backing layout only after confirming a selected keyboard layout; it cannot promote an IME’s underlying ABC layout into an Alt default. Native snapshot invalidation and existing input/release handling stay in place.
Terminal settings explain the choices in all supported languages, identify ABC/U.S. accurately, and correct the Chinese Right label. Added punctuation and live-layout regression coverage.
Why
ABC and U.S. should receive the same terminal policy: on the tested macOS 26.3.1 system, their native layout data was byte-for-byte identical, with matching results for 512 translations and the checked dead-key sequences. The previous ABC distinction did not follow a different character mapping.
Changing every layout or forcing Left would override unrelated text-entry choices. The exact ABC alias solves the shortcut problem while keeping explicit composition and international layouts available. Missing-source detection stays conservative because an IME can expose a U.S.-shaped backing layout.
Linked Issue
Related: #1205 and #20171. Preserves explicit composition decisions from #21082 and #22608, and the IME/release boundaries reviewed in #14743, #23584, and #8810.
Visual Proof
Same actual ABC input source and Auto setting, captured from hidden macOS Electron renderers:
Before:
After:
Testing
Passed:
pnpm tc, changed-code quality gate, focused lint/format checks, localization catalog/extraction/runtime checks, the Electron E2E build, 322 focused unit tests, and 19 Electron tests. Four Linux-only exact-byte IME tests were skipped on macOS.The new Electron check retains the same mounted terminal across ABC → international → ABC → IME backed by ABC → ABC → unknown → ABC. It asserts exact Option+. press/release bytes under negotiated flags, the Auto description and persisted setting, explicit Off text, and split Option behavior. Existing legacy punctuation and CJK committed-text checks also pass.
No physical native-IME composition, actual application effort-screen switching, Windows/Linux desktop, or live SSH run was performed. E2E typecheck has existing repository errors; neither changed E2E file has diagnostics. Full lint, full tests, and packaging remain for CI.
Review
Independent review checked the exact input-source allowlist, selected IME precedence, conservative failure handling, modifier sides, active-layout encoding, paired releases, and translated labels. No outstanding findings.
Agent skill upstream boundary
Notes
This intentionally changes Auto for ABC: users who want Option-produced text on both sides can select Off, or Left/Right for a split. The setting default is still Auto; existing explicit preferences are not migrated. The input policy runs on the client through existing terminal routes for local and SSH panes, worktrees and folder workspaces. No transport or execution-host changes.
Checklist