Repository navigation
Conversation
macOS Korean input sources put ₩ (U+20A9) on Backquote, so users remap it to ` via ~/Library/KeyBindings/DefaultKeyBinding.dict. AppKit applies that substitution in the text input path, and Chromium surfaces it only on the keypress/input events — keydown still carries the raw ₩. xterm derives the PTY payload from keydown.key and preventDefault()s, which suppresses the Char event, so the remapped ` never reaches the shell. ₩ fell through every existing guard: CJK_DIRECT_PUNCTUATION_KEYS has ¥ (U+FFE5) but not ₩, the non-ASCII xterm bypass is scoped to shifted keys, and the JIS Yen rewrite is scoped to code === 'IntlYen'. Claiming it as a native-text candidate routes the keydown around xterm so the committed glyph is forwarded from the input event. Fixes stablyai#11170
|
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 (2)
📝 WalkthroughWalkthroughAdds the Korean won symbol ( 🚥 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 |
|
Heads up: this PR now has no remaining delta against Rebasing
The Leaving this open for a maintainer to call — closing as superseded by #11293 looks right to me, but I would rather not close it myself in case any part of the fix is still wanted separately. |
|
Closing as superseded — confirmed against The Coverage for the remap case lives on in |
Summary
Fixes #11170.
macOS Korean input sources put
₩(U+20A9) on the Backquote key, so a backtick is unreachable without switching input source. The standard workaround is a~/Library/KeyBindings/DefaultKeyBinding.dictremap:{ "₩" = ("insertText:", "`"); }That remap works in every other app — including Orca's own text inputs — but not in the Orca terminal, which sends the raw
₩to the PTY.Why: AppKit applies the substitution in the text input path, and Chromium surfaces the result only on the keypress/input events. Probe capture with a Korean input source active:
xterm derives the PTY payload from
keydown.keyand callspreventDefault(), which makes Chromium suppress the following Char event — so the keypress and input carrying`never fire and only the raw layout character survives.₩fell through all three existing guards:CJK_DIRECT_PUNCTUATION_KEYScarries¥(U+FFE5) but not₩(U+20A9); the non-ASCII bypass inxterm-bypass-policy.tsis scoped toevent.shiftKey; andterminal-jis-yen-input.tsis scoped tocode === 'IntlYen'behind an opt-in setting.Change: add
₩toCJK_DIRECT_PUNCTUATION_KEYSsoinstallTerminalImeNativeTextForwarderclaims the keydown, routes it around xterm, and forwards the committed glyph from theinputevent — the mechanism this file already provides for "committed text differs fromkeydown.key". Users without the dict are unaffected: the forwarder passes through whatever text actually commits, which is₩.Considered and rejected: dropping the
shiftKeycondition from the non-ASCII bypass. It would cover any dict-remapped non-ASCII key, but it changes the code path for every keystroke on all non-Latin layouts (Cyrillic, Greek, Thai, …) and silently drops keys that emit no keypress. Too broad for this defect.Screenshots
No visual change.
Testing
pnpm lintpnpm typecheckpnpm testpnpm buildThree regression tests in
terminal-ime-native-text-forwarder.test.ts, written failing first and confirmed failing before the fix:₩keydown is a native-text candidate even when the input-source probe is stale.`) is forwarded from the input event.₩is forwarded unchanged when no dict remap exists — pins the behavior for users who do not remap.terminal-panesuite: 193 files / 2522 tests pass. Full suite: 8 files / 43 tests fail, all pre-existing — verified identical failure counts onupstream/mainwithout this change (window.localStorageis not implemented under Node 25.x, plus one flaky timing assertion).oxlintfindings on this machine came only from untracked local worktree copies under.orca/and.claude/; scoped tosrc config tests mobileit is clean.AI Review Report
Reviewed with systematic root-cause debugging rather than symptom patching: captured real key-event evidence before proposing a fix, confirmed the xterm payload rule in the shipped bundle (
keyCode >= 48 && key.length === 1 → result.key = ev.key), and verified_keyPressreadse.charCodeand stays reachable because_keyDownHandledremains false when a custom handler bypasses the keydown.Risks checked:
isImeNativeTextKeydownCandidatehas exactly one consumer,terminal-ime-native-text-forwarder.ts, whichuse-terminal-pane-lifecycle.tsinstalls only whenisMac; on Windows and LinuxclaimKeyEventis a constantfalse, so this is a no-op there. No shortcut, accelerator, label, or path handling is touched, and nothing here assumes local execution, so SSH sessions and folder workspaces behave identically.₩still arrives as₩.isImeNativeTextKeydownCandidatestill rejects Ctrl/Alt/Meta, soOption+₩continues to fall through toterminalMacOptionAsAltas before.inputevent followed a claimed keydown the glyph would be lost; the existing 100 ms disarm timer and keyup handling already cover that, and the probe shows the input event always fires for this key.Security Audit
No new IPC, command execution, path handling, auth, secrets, or dependency surface. The only data flow added is an existing one widened by one character: text from a focused terminal element's
InputEvent.datais passed topane.terminal.input()— the same path every typed character already takes, subject to the same PTY input guards. Input is a single committed glyph from the OS text input system, not attacker-controlled content, and it is neither parsed nor interpolated into a command. No follow-up needed.Notes
keydown.keyis already`."~₩" = ("insertText:", "₩")dict rule (Option + the key). Modifier chords are deliberately excluded from the native-text claim, andterminalMacOptionAsAltconsumes Option first. Left unchanged rather than widening the claim to modifier chords.