Skip to content

[Bug]: macOS Korean 2-Set IME swallows Ctrl+A/Ctrl+U in Codex terminal input #13331

Closed

Description

@GinnieII
No description provided.

Activity

  1. AmethystLiang commented on Aug 9, 2026

    @AmethystLiang
    Contributor

    thanks for reporting. looking into it

  2. manuaudio commented on Aug 9, 2026

    @manuaudio
    Contributor

    The issue body came through empty, so there's no repro or version to work from — but I checked the two places in Orca that could plausibly intercept those chords before the PTY sees them, and both are clear. That should narrow what to ask for.

    Neither Orca interception point takes Ctrl+A / Ctrl+U

    The native-only shortcut path is armed for one action only. src/renderer/src/components/terminal-pane/keyboard-handlers.ts:436:

    if (action.type === 'switchInputSource') {
      // Why: the OS must receive its default action, while xterm must receive
      // none of the keydown, keypress, or keyup sequence.
      nativeOnlyShortcutTracker.armKeyDown(e)

    That tracker is the mechanism that deliberately hides a chord from xterm, and it only engages for the input-source switch. Unless a keybinding maps Ctrl+A or Ctrl+U to switchInputSource, they never enter it.

    The main-process shortcut layer explicitly declines them. src/shared/window-shortcut-policy.ts:288-292:

    this helper is the explicit allowlist for main-process interception. Anything not listed here must keep flowing to the renderer/PTY so readline chords like Ctrl+R, Ctrl+U, and Ctrl+E are not accidentally stolen while terminals own focus

    So both layers are designed to let these through, and I can't see a path where Orca swallows them on its own. That points at the IME or the input pipeline below it rather than at shortcut routing — which is a different fix and a different owner.

    What would make this actionable

    The distinction that matters most: does it fail only while a Hangul syllable is mid-composition, or also when nothing is being composed? Those are two different bugs. Korean 2-Set keeps a composition session open across keystrokes in a way Latin layouts don't, and a chord arriving mid-composition is a very different situation from one arriving at a settled prompt.

    Alongside that:

    • Does it reproduce in a plain shell pane (bash/zsh, where Ctrl+U is readline kill-line), or only in Codex?
    • Does the same terminal accept Ctrl+A/Ctrl+U when the input source is switched to ABC/US?
    • Apple's built-in 2-Set, or a third-party IME?
    • Orca version.

    The first two separate "Orca terminal input" from "Codex's own key handling", and the third separates Apple's IME from everything else. Without at least those, the trail stops at the two cleared layers above.

    Read from source; no Korean IME configured here, so I have not attempted a repro.

  3. AmethystLiang commented on Aug 9, 2026

    @AmethystLiang
    Contributor

    @nwparker is looking into this

  4. AmethystLiang commented on Aug 14, 2026

    @AmethystLiang
    Contributor

    Related: #14460 reports Ctrl+C swallowed by the same macOS Korean 2-Set IME, with open fixes in #14430 / #14462. Those PRs are intentionally Ctrl+C-only and do not deliver Ctrl+A/Ctrl+U, so this issue stays open.

  5. nwparker commented on Aug 14, 2026

    @nwparker
    Contributor

    Fixed in #14469 (b6d36c2).

    Root cause, in case it is useful: macOS itself resolves control chords by physical key on every layout — measured with UCKeyTranslate, physical A/U under Control give U+0001/U+0015 on 2-Set Korean exactly as on ABC, even though those keys type ㅁ/ㅕ. Native terminals get that for free by passing the OS bytes through. In a browser we do not see it: KeyboardEvent.key only carries ㅁ.

    xterm has two encoders. The legacy one reads keyCode and was always fine, so this only ever broke with the kitty keyboard protocol negotiated — which is why you saw it in Codex and probably not in a plain shell. The kitty encoder derives the key number from key and only consults the physical code when Shift or Option is held; Ctrl was not in that gate, so Ctrl+A reported CSI 12609;5u instead of CSI 97;5u.

    It now recovers the letter from code whenever key is non-ASCII, which reproduces what the OS would have sent. Applies to all of A–Z (Ctrl+C already had its own path from #14460), and to Russian/Greek/etc, not just Korean. An ASCII key is still authoritative so Dvorak remaps keep working.

    Worth a re-test on your side when it ships — I verified the layout data and the unit behaviour on macOS and Windows, but not a live end-to-end run with 2-Set active driving a TUI.

  6. added a commit that references this issue on Aug 14, 2026
    b6d36c2
  7. nwparker commented on Aug 14, 2026

    @nwparker
    Contributor

    Confirmed on hardware. macOS with the 2-Set Korean input source active, running d137bb9 (both fixes on main): Ctrl+A and Ctrl+C both work in a terminal pane.

    That closes the gap I flagged when this merged — until now it rested on measured layout data plus unit tests, with no live run. Ctrl+A is the meaningful one here: Ctrl+C had its own ETX bypass since #3941 and may well have worked before, so Ctrl+A behaving is what actually demonstrates the general fix.

    Measured event shape from the same machine, for the record:

    Ctrl+A   key=ㅁ U+3141   code=KeyA   keyCode=65
    Ctrl+C   key=ㅊ U+314A   code=KeyC   keyCode=67
    Ctrl+U   key=ㅕ U+3155   code=KeyU   keyCode=85
    Ctrl+W   key=ㅈ U+3148   code=KeyW   keyCode=87
    

    Exactly as reported: the layout glyph lands in key while code and keyCode survive intact, which is what the fix keys off.

    Ctrl+U and Ctrl+W were not tried in this pass. They go through the same code path as Ctrl+A with no per-letter branching, and are covered by unit tests across the full A-Z range, so I expect them to work — but I have not watched them.

  8. added a commit that references this issue on Oct 15, 2026
    7de918c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions