Skip to content

[Bug]: Grok terminal shows literal [13;2u (Shift+Enter CSI-u leak) and long-output garble #8385

Closed

Description

@bbingz

Summary

In Orca-hosted Grok (terminal TUI, not Native Chat), long sessions can show garbled top-half text, hard-to-read scroll, and literal keyboard garbage like:

[13;2u
[13;2

Reported on Orca 1.4.137, macOS + Windows, local only, Grok only.

Evidence

[13;2u is the Kitty keyboard protocol encoding for Shift+Enter (CSI 13 ; 2 u) with the leading ESC stripped. That means Orca injected CSI-u key bytes while the application was not (or no longer) decoding Kitty keyboard.

Root cause (fix)

On macOS/Linux, Orca always sent Shift+Enter as \x1b[13;2u regardless of whether the pane had enabled Kitty keyboard (CSI > u). When Grok (or any TUI) was CSI-u-blind, those bytes appeared as literal text and could corrupt the composer / redraw.

Windows agent-declared CSI-u (Droid) is unchanged. Grok is also declared as CSI-u on trusted Windows foreground so newline works once KKP is active (same class as Droid).

Fix

  • Gate non-Windows Shift+Enter CSI-u on active KKP flags; otherwise send Esc+CR.
  • Gate Ctrl+Enter CSI-u the same way (avoid [13;5u leak).
  • Set windowsShiftEnterEncoding: 'csi-u' for Grok.

Reproduction notes

  1. Open Grok agent terminal in Orca (not Native Chat).
  2. Press Shift+Enter when Kitty handshake is not active (startup race / after mode reset).
  3. Observe literal [13;2u in the composer or screen corruption on long redraws.

Activity

  1. self-assigned this
    on Jul 12, 2026
  2. gawaguci commented on Aug 3, 2026

    @gawaguci

    Regression data point from Windows:

    • OS: Windows 11 Pro, build 22631
    • Orca: 1.4.164
    • Codex CLI: 0.146.0
    • Input method: Microsoft Korean IME (2-beolsik)

    In an Orca-hosted Codex terminal/composer, pressing Ctrl+Enter produces the literal text [13;5u and inserts a newline. After that chord, unexpected newlines continue while typing Korean text.

    This is the exact CSI 13;5u leakage class described in this issue. It is reproducible on 1.4.164, so the Ctrl+Enter path appears to have regressed or to bypass the previous KKP-active gate in the Windows IME/composer route.

    Expected behavior: Orca must never insert raw CSI-u bytes into the prompt. Ctrl+Enter should be handled by the active TUI/shortcut policy, and ordinary Korean composition after the chord must not synthesize newlines.

    I found the related Windows IME fixes noted for 1.4.167 and will retest after updating, but I am reporting the exact raw Ctrl+Enter leakage here because it reproduces reliably on 1.4.164.

  3. gawaguci commented on Aug 3, 2026

    @gawaguci

    Follow-up: I updated the same Windows host from Orca 1.4.164 to 1.4.167.

    Verification on 1.4.167:

    • Orca runtime reports appVersion: 1.4.167 and is ready.
    • In a fresh Orca-hosted Codex session, an actual Ctrl+Enter hotkey submitted a marker message cleanly.
    • The composer cleared normally; no literal [13;5u appeared and no persistent newline state followed.
    • The 1.4.167 renderer bundle now gates Windows IME Process/229 modified-Enter handling on physical Enter/NumpadEnter codes and clears held modifier/Enter tracking on blur.

    On this host, updating from 1.4.164 to 1.4.167 resolves the reported behavior.

  4. gawaguci commented on Aug 3, 2026

    @gawaguci

    Correction to my previous follow-up: Orca 1.4.167 is not fixed for Ctrl+Enter in the integrated terminal. My earlier passing check targeted Orca's native chat composer, not the actual xterm Terminal input.

    A real integrated-terminal retest on the same host still reproduces literal [13;5u. The 1.4.167 bundle still emits \x1B[13;5u unconditionally for Ctrl+Enter, while Shift+Enter gates CSI-u on the active keyboard protocol. I isolated and locally validated that code path and opened a dedicated regression report with the bundle snippet and reproduction details:

    Please treat my earlier “resolved on 1.4.167” comment as retracted.

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