Repository navigation
Conversation
Electron reports the physical C key as the Hangul jamo ㅊ while the Korean input source is active. Resolve that non-ASCII key through the existing KeyboardLayoutMap cache before deciding whether xterm should forward ETX, while preserving logical-layout behavior such as Dvorak.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughTerminal pane creation now prefetches keyboard layout base characters before IME setup. Terminal interrupt detection maps single non-ASCII printable keys through their physical key codes before checking for 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
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 |
|
Closing for now while the fix is redesigned around a general, cross-platform IME Ctrl+letter normalization path and clearer visual proof. |
|
Reopened after the broader Ctrl-letter design review. The generalized local experiment exposed overlap with the existing physical-key ownership/release machinery and would widen this fix unnecessarily, so the PR is intentionally back to the original Ctrl+C-only patch. I also added the focused issue #14460, refreshed the description against the current template, and replaced the recordings with cropped, enlarged Before/After GIFs that show both Ctrl+C presses and the final terminal state. |
|
Your diagnosis was right and I built on it — thank you for the measured event shape and the recordings, they made this quick to confirm. I landed a widened fix in #14462 ( 1. It is not Korean-only. Any non-Latin source hits it — Russian and Greek fail identically, since 2. A measurement that I think breaks the layout-map approach. I probed every installed layout on a real macOS host with Korean 2-Set is a keyboard layout, not an IME layered over QWERTY — its KeyC really is Caveat I want to be honest about: I measured the OS layout, not Chromium's The merged fix keeps your layout-map idea as tier 2 (it is what makes a genuine IME-over-Latin source precise rather than merely positional) and adds a positional fallback as tier 3 for true non-Latin layouts. So it lands the same answer either way. Closing thought: if you can measure #13331 (Ctrl+A / Ctrl+U) may be the same helper and worth re-testing on your side now. |
|
Correction to my last line: I checked, and #13331 is not fixed by this. |
|
Closing since #14462 landed and fixes #14460 — your diagnosis and your layout-map idea are both in it, credited in the PR body. Not closing because the patch was wrong: it was a correct read of the bug and the first working analysis of it. It's superseded because the merged version widens it to every non-Latin source and adds the positional fallback the hardware measurement turned out to need. Reopen if you disagree with the measurement — and if you can get |
ELI5
With the macOS Korean 2-Set input source active, Electron reports the physical C key as a Hangul character instead of
c. Orca therefore missed Ctrl+C and Codex stayed open after repeated interrupt attempts. This patch uses Orca's existing keyboard-layout map to recognize that key as C and deliver the normal terminal interrupt.What Changed
event.keythrough the existingKeyboardLayoutMapcache when checking for Ctrl+C.The patch intentionally remains Ctrl+C-specific. It does not introduce another general shortcut state machine or change terminal/session restoration.
Why
The measured macOS Korean 2-Set event is
key: "ㅊ",code: "KeyC", with Ctrl held. Matching only logicalcmisses it, while treating every physicalKeyCas C would break layouts such as Dvorak.Orca already caches Chromium's layout-aware base character for a physical code. Consulting that cache only when
keyis one non-ASCII printable character fixes the measured event while leaving ASCII logical keys authoritative and preserving the existing platform and clipboard policies.Linked Issue
Fixes #14460
Related: #13331 reports Ctrl+A and Ctrl+U under the same input source; those broader chords are deliberately outside this focused patch.
Visual Proof
Both recordings use the same isolated Orca E2E profile, the real Codex CLI, and the measured Korean 2-Set event shape. The terminal is cropped and enlarged, and the two Ctrl+C presses share the same timeline for direct comparison.
Before: both Ctrl+C presses are swallowed and Codex remains open.
After: ETX reaches the terminal and Codex returns to the shell.
Testing
Revalidated on macOS:
corepack pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/xterm-bypass-policy-interrupt.test.ts src/renderer/src/components/terminal-pane/xterm-bypass-policy-non-mac.test.ts src/renderer/src/lib/keyboard-layout/layout-base-character.test.tscorepack pnpm run typecheckThe targeted tests cover the Korean event shape, Dvorak logical-key precedence, keyup suppression, unavailable layout maps, and unchanged Windows/Linux Ctrl+C selection behavior. The earlier full local validation also covered lint, production builds, and the macOS native build; CI will repeat the repository-wide checks.
Actually exercised on macOS with Korean 2-Set. Linux and Windows were not manually exercised; their unchanged branches are covered by the non-macOS policy tests.
AI Disclosure
OpenAI Codex was used for diagnosis, implementation, tests, recording preparation, and PR drafting. The keyboard event and final behavior were also verified in the running Electron app.
Review
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)Author