Skip to content

[Bug] Codex CLI 0.161.0 generates garbled characters when moving the mouse in JetBrains integrated terminal on Windows #52003

Not planned

Description

@Studypythonhardly

What version of the Codex App are you using (From “About Codex” dialog)?

Codex CLI 0.161.0 (not Codex Desktop App)

What subscription do you have?

ChatGPT Plus

What platform is your computer?

Microsoft Windows NT 10.0.19045.0

What issue are you seeing?

Bug Description

When using Codex CLI 0.161.0 inside the integrated terminal of a JetBrains IDE on Windows, moving the mouse cursor causes a large number of garbled characters to appear automatically in the terminal.

This happens without typing or pasting anything. The issue makes the terminal difficult to use and interferes with normal interaction with Codex CLI.

The unexpected characters appear to resemble raw terminal mouse-event escape sequences that are not being handled correctly.

Environment

  • Application: Codex CLI
  • Version: 0.161.0
  • Operating System: Windows
  • Terminal: JetBrains IDE integrated terminal
  • Installation method: Not specified

Steps to Reproduce

  1. Open a JetBrains IDE on Windows.
  2. Open the IDE's integrated terminal.
  3. Launch Codex CLI by running codex.
  4. Move the mouse cursor over the terminal area.
  5. Observe that large amounts of garbled text appear automatically in the terminal, even without keyboard input.

Expected Behavior

Moving the mouse cursor within the integrated terminal should not generate unexpected characters or interfere with Codex CLI input.

The terminal should only display user input and normal Codex CLI output.

Actual Behavior

Simply moving the mouse cursor causes the terminal to display a continuous stream of garbled characters.

The issue makes it difficult to interact with Codex CLI normally.

Additional Information

Could the Codex team investigate whether this issue is still present in version 0.161.0 and whether it is related to mouse-event handling in JetBrains terminals?

Thank you!

Image

What steps can reproduce the bug?

  1. Open a JetBrains IDE on Windows.
  2. Open the integrated terminal inside the IDE.
  3. Run codex to launch Codex CLI 0.161.0.
  4. Wait for the Codex CLI interface to load.
  5. Move the mouse cursor around the terminal window, especially over the Codex input area.
  6. Observe that large amounts of garbled characters are automatically inserted into the terminal without any keyboard input.

Reproducibility: The issue occurs repeatedly when moving the mouse within the terminal.

Additional notes:

  • Codex CLI version: 0.161.0
  • Environment: JetBrains IDE integrated terminal on Windows
  • No keyboard input or text pasting is required to trigger the issue.
  • The garbled characters appear to resemble incorrectly processed terminal mouse-event escape sequences.
  • A screenshot demonstrating the issue has been attached.

What is the expected behavior?

No response

Additional information

No response

Activity

  1. added
    app
    on Oct 8, 2026
  2. added
    bug
    CLI
    windows-os
    TUI
    on Oct 8, 2026
  3. github-actions commented on Oct 8, 2026

    @github-actions
    Contributor

    Potential duplicates detected. Please review them and close your issue if it is a duplicate.

    Powered by Codex Action

  4. etraut-openai commented on Oct 10, 2026

    @etraut-openai
    Contributor

    (response from codex)

    Thanks for the report. Windows 10 is out of Microsoft’s general support, and Codex support on updated Windows 10 systems is best effort.

    As a workaround, run /tui, select Scrollback, and restart Codex. Please let us know whether that stops the corruption.

    To help diagnose, could you also share:

    • Your exact JetBrains IDE/version, terminal engine (Classic or Reworked), and shell/version.
    • The full Windows build from winver.
    • codex --version from that terminal.
    • A short sample of the garbled text.
    • Whether it also happens in Windows Terminal on the same machine.
  5. blindvigil commented on Oct 20, 2026

    @blindvigil

    Current Windows desktop reproduction

    I can reproduce the same class of mouse-reporting corruption in the Codex Windows desktop app, not only in a JetBrains terminal.

    Environment

    • Codex Windows package: 26.930.7945.0
    • Windows 11 25H2, build 26200.9457, x64

    Observed behavior

    • Moving the physical mouse causes raw VT/X10-style mouse-report bytes to be inserted directly into the Codex prompt/composer without keyboard input.
    • A captured sample is:
    [MC:H[MC9H[MC9G[MC8G[MC7F[MC6E[MC5D[MC3C[MC2B[MC0@[MC/?[MC/@[MC2A[MC4B[MC:B[MC>B[MCAB[MCCB[MCBB[MC>C[MC<D[MC9D[MC8D[MC8C[MC7B[MC6@[MC5>[MC6<[MC8;[MC::[MC>9[MC@9[MCB9[MCC9[MCE:[MCF:[MCF;[MCG<[MCE<[MCC<[MCA<[MC=<[MC<<[MC9=[MC7>[MC4@[MC3B[MC2D[MC3E[MC5F[MC9G[MC=G[MCCG[MCHF[MCJE[MCKD[MCKB[MCJA[MCH@[MCF@[MCE@[MCC@[MCAA[MC=B[MC<B
    
    • Once triggered, the prompt remains corrupted/unusable. Clearing the prompt does not recover normal input; Codex must be fully closed and reopened.
    • The trigger is intermittent, but the failure is persistent for the remainder of the app session after it begins.

    Expected behavior
    Mouse input must never be routed into the chat composer as terminal escape-sequence text. If mouse-reporting state becomes invalid, the app should reset it without requiring a full restart.

    This is severe because it interrupts the active task and forces an application restart.

  6. davidcgie commented on Oct 29, 2026

    @davidcgie

    thread id: 01a18715-a5ca-77e0-9617-da971b3a78a6

    happens also on windows in visual studio code codex cli. no idea what it is triggered by. only fix is to /exit and start codex cli again

  7. removed
    app
    on Nov 26, 2026
  8. marked IDEA terminal bug #53248 as a duplicate of this issue on Nov 26, 2026
  9. etraut-openai commented on Nov 26, 2026

    @etraut-openai
    Contributor

    (response from codex)

    Thanks for the report. I reproduced this on Windows 10 in IntelliJ IDEA Community 2025.1.2 with Codex CLI 0.161.0 and 0.172.0.

    To work around it, launch codex --no-alt-screen, or run /tui, select Scrollback, and restart Codex. I verified the launch flag in IntelliJ, and a GoLand user confirmed that Scrollback worked.

    In the IntelliJ build I tested, the Windows console bridge sent one command to enable both mouse tracking and SGR mouse encoding. JediTerm, the terminal emulator bundled with IntelliJ, applied only the first setting. Windows then delivered parts of the mouse reports to Codex as keystrokes.

    When I temporarily changed JediTerm to apply both settings, the corruption stopped in Fullscreen with both Codex versions unchanged. I haven’t verified whether JetBrains has shipped a fix.

    I’m closing this as not planned because the fix for the JetBrains behavior I reproduced belongs in JediTerm. The VS Code and Windows desktop reports may have different causes. For VS Code, #60125 documents a similar failure after reloading the window.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLITUIbugwindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions