Skip to content

[Bug]: Ctrl+Enter leaks literal [13;5u in 1.4.167 Windows ConPTY terminal #12329

Closed

Description

@gawaguci

Environment

  • Windows 11 Pro, build 22631
  • Orca 1.4.167
  • Codex CLI 0.146.0
  • Microsoft Korean IME (2-beolsik)
  • Orca integrated terminal (xterm.js + local Windows ConPTY; not Windows Terminal)

Reproduction

  1. Open a Codex session in Orca's integrated terminal.
  2. Focus the actual xterm Terminal input.
  3. Press Ctrl+Enter.
  4. The literal text [13;5u is inserted. Repeating the chord repeats that string, and subsequent Korean input can exhibit repeated/unexpected newlines.

Root cause found in the 1.4.167 renderer bundle

In out/renderer/assets/terminal-shortcut-policy-BmRK03X0.js, Shift+Enter checks whether CSI-u/Kitty keyboard handling is active before emitting CSI-u:

data: isWindowsTerminalHost() && getWindowsShiftEnterEncoding?.() === "csi-u" || isKittyKeyboardActivePane?.() === true
  ? "\x1B[13;2u"
  : "\x1B\r"

Ctrl+Enter does not perform that check and always emits CSI-u:

data: "\x1B[13;5u"

On local native Windows ConPTY, Orca does not have an active Kitty keyboard protocol for this pane, and Codex receives/prints the raw sequence instead of decoding it as Ctrl+Enter.

Local validation

I changed the Ctrl+Enter branch locally to:

data: isKittyKeyboardActivePane?.() === true ? "\x1B[13;5u" : "\r"

After repacking app.asar, restarting Orca, and testing the real xterm Terminal input, Ctrl+Enter produced a normal CR and no new [13;5u leakage. This confirms that the unconditional Ctrl+Enter CSI-u emission is the remaining defect.

Expected

Ctrl+Enter must not emit CSI-u unless the active terminal application has negotiated/enabled the corresponding keyboard protocol. In a native Windows ConPTY pane without KKP, it should use a safe fallback and never inject raw [13;5u into user text.

Related: #8385. My earlier follow-up there incorrectly tested the native chat composer rather than the integrated terminal; I will correct that comment and link this issue.

Activity

  1. ShreyanshVaibhaw commented on Aug 3, 2026

    @ShreyanshVaibhaw

    Opened #12331 for this. Your diagnosis was correct and matched the source exactly.

    For the record in src/renderer/src/components/terminal-pane/terminal-shortcut-policy.ts, the Shift+Enter branch guards its CSI-u emission:

    const canSendCsiU = hasTrustedWindowsCsiU || isKittyKeyboardActivePane?.() === true
    return { type: 'sendInput', data: canSendCsiU ? '\x1b[13;2u' : '\x1b\r' }

    while Ctrl+Enter three lines below did not, and its comment even acknowledged the gap ("no Windows fallback yet (#2418)").

    The PR takes your fallback: gate the sequence on active kitty keyboard, otherwise send the bare CR that xterm.js would have collapsed Ctrl+Enter to. That restores the pre-interception default rather than inventing an encoding. Regression test confirmed to fail against the previous implementation.

    Two notes:

    • I used isKittyKeyboardActivePane alone rather than also borrowing Shift+Enter's getWindowsShiftEnterEncoding signal, since that setting is specifically about the Shift+Enter encoding and reusing it to authorize a different chord would couple two unrelated decisions.
    • The PR only fixes the literal [13;5u leak. The repeated-newlines-on-Korean-input symptom you also mention is a different path (the IME composition handler) and is covered separately in fix(terminal): stop Shift+jamo from injecting a newline while an IME composes #12187.

    I could not reproduce first-hand, since I do not have Codex on a Korean IME Windows setup, so this is verified by tests rather than observation. If you are able to confirm on 1.4.167 with the branch, that would be worth having before merge.

  2. added 2 commits that reference this issue on Aug 7, 2026
    4ae8e80
    4b26034
  3. added a commit that references this issue on Oct 15, 2026
    32e512f
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