Skip to content

Regression: Codex CLI 0.131.0-alpha.22 prints raw ANSI escape sequences in Windows TUI startup/resume #23031

Closed

Description

@adelfino69

What version of Codex CLI is running?

Affected:

codex-cli 0.131.0-alpha.22

Regression baseline that did not show the issue on the same machine/workflow:

codex-cli 0.131.0-alpha.9

What subscription do you have?

ChatGPT/Codex authenticated account.

Which model were you using?

gpt-5.5 with xhigh reasoning, but this appears to be a local TUI/rendering startup issue rather than model-specific.

What platform is your computer?

Windows / PowerShell environment.

Observed from PowerShell sessions on Windows. Exact terminal host has not been fully isolated yet.

Terminal emulator and version

Not fully isolated yet. The issue was observed in normal Windows PowerShell/Codex CLI usage.

What issue are you seeing?

After upgrading from 0.131.0-alpha.9 to 0.131.0-alpha.22, some Codex CLI sessions and working directories render raw terminal escape sequences directly into the TUI instead of interpreting them.

The output includes visible control sequences such as:

ESC]0;gisSolution
ESC[?2026h
ESC[?2026l
ESC[39;49m
ESC[K
ESC[2;1H
ESC[2;41r
ESC[0 q
ESC[?25h

In the terminal these appear as visible ←[ / ←] sequences, for example:

←]0;gisSolution←]0;⠹ gisSolution←[?2026h←[2;1H←[J...

The most visible failure is during TUI startup while MCP/plugin/hook/skill startup messages are being rendered. Example startup lines around the corruption:

Starting MCP servers (0/3): cloudflare-api, codex_apps, context7
Starting MCP servers (0/2): cloudflare-api, codex_apps

Warnings that were being rendered around the same time included plugin/hook/skill warnings such as:

[features].codex_hooks is deprecated. Use [features].hooks instead.
loading hooks from both C:\Users\...\.codex\hooks.json and C:\Users\...\.codex\config.toml; prefer a single representation for this layer
Skipped loading 20 skill(s) due to invalid SKILL.md files.
... SKILL.md: invalid YAML: mapping values are not allowed in this context ...

Initially this looked resume-specific, because one important resumed session showed the problem, but a fresh session in the same kind of Windows working directory also reproduced it. Other sessions/directories may render normally.

Regression signal

This is the key signal:

  • 0.131.0-alpha.9: same user/workflow did not show raw ANSI corruption.
  • 0.131.0-alpha.22: raw ANSI sequences appear in some sessions/directories, especially around startup/resume with MCP/plugin/hook/skill output.

This makes it look like a regression in the TUI rendering/startup path, possibly amplified by plugin hooks / MCP startup warnings.

Investigation notes

Local comparison of rust-v0.131.0-alpha.9...rust-v0.131.0-alpha.22 showed a large amount of churn in the relevant areas:

The visible ESC[?2026h / ESC[?2026l sequences look like DEC private mode 2026 / synchronized output toggles being printed literally. The issue is not that these sequences exist; it is that they are leaking visibly into the terminal output.

What steps can reproduce the bug?

The repro is not fully minimal yet, but this is the observed pattern:

  1. On Windows, install/use Codex CLI 0.131.0-alpha.22.
  2. Open PowerShell.
  3. Start Codex in a Windows project directory that loads MCP/plugin/hook/skill configuration.
  4. Example command used:
codex --dangerously-bypass-approvals-and-sandbox
  1. Or resume an affected session:
codex --dangerously-bypass-approvals-and-sandbox resume 019e20c6-4b39-7e43-9ce6-fb5bfc577c81
  1. Observe startup while MCP servers/plugins/hooks/skills initialize.
  2. Raw terminal control sequences appear directly in the visible TUI output.

A fresh session in one affected working directory reproduced the issue, so it is not only old transcript replay from the resumed session.

Workarounds tried

These were tried and did not resolve the issue in the affected setup:

codex --no-alt-screen --disable terminal_resize_reflow --disable plugin_hooks --disable plugins --disable hooks --dangerously-bypass-approvals-and-sandbox

Also tested with resume:

codex --no-alt-screen --disable terminal_resize_reflow --disable plugin_hooks --disable plugins --disable hooks --dangerously-bypass-approvals-and-sandbox resume 019e20c6-4b39-7e43-9ce6-fb5bfc577c81

The practical workaround is to run 0.131.0-alpha.9 for affected sessions while keeping 0.131.0-alpha.22 globally for other work.

What is the expected behavior?

Codex should keep the terminal in a valid render state during startup/resume. Terminal escape sequences should be interpreted by the terminal or safely avoided, not printed visibly into the TUI.

Warnings from invalid skills, deprecated config keys, duplicate hooks, or MCP startup should not corrupt the TUI display.

What happens instead?

Raw ANSI/OSC/DEC control sequences are shown as visible text in the Codex TUI during startup/resume. The screen becomes hard to read, and affected sessions/directories feel visually corrupted.

Additional context

I fixed several local config/plugin issues during investigation:

  • migrated [features].codex_hooks to [features].hooks
  • removed duplicated hook representation between hooks.json and config.toml
  • fixed invalid YAML in multiple local SKILL.md files
  • disabled a problematic autoresearch plugin/cache locally

Those fixes reduced some warnings, but the raw ANSI rendering still occurred in affected cases on 0.131.0-alpha.22.

Related issues / nearby areas checked

I found related but not exact issues:

This report is specifically about a regression from 0.131.0-alpha.9 to 0.131.0-alpha.22 where raw terminal control sequences leak visibly during Windows TUI startup/resume, especially around MCP/plugin/hook/skill rendering.

Activity

  1. added
    bug
    CLI
    windows-os
    TUI
    on May 16, 2026
  2. added
    regression
    and removed
    CLI
    on May 16, 2026
  3. fcoury-oai commented on May 16, 2026

    @fcoury-oai
    Contributor

    Could you run a /feedback in one of your sessions and send me the session id?

  4. adelfino69 commented on May 16, 2026

    @adelfino69
    Author
  5. fcoury-oai commented on May 16, 2026

    @fcoury-oai
    Contributor

    Thanks, can you instead run this with alpha.22 and send me the output?

     codex doctor --all
    
  6. adelfino69 commented on May 16, 2026

    @adelfino69
    Author
  7. fcoury-oai commented on May 16, 2026

    @fcoury-oai
    Contributor

    Would you mind sending a screenshot of the issue as well?

  8. adelfino69 commented on May 16, 2026

    @adelfino69
    Author
  9. runfence commented on May 20, 2026

    @runfence

    Same for me #23628

  10. dano1066 commented on May 20, 2026

    @dano1066

    Same issue, had to rollback to version 0.130 to fix it

  11. 5 remaining items

  12. runfence commented on May 22, 2026

    @runfence

    @fcoury-oai , I don't have Git for Windows installed. I use SmartGit with git bundled in. The version is not newest because my license for smartgit updates is expired.

  13. fcoury-oai commented on May 22, 2026

    @fcoury-oai
    Contributor

    @runfence you can either upgrade to a newer git temporarily or wait for the next release.

  14. nikkelly commented on May 22, 2026

    @nikkelly

    I was able to trace it to an issue with the old git version. Can you try running git update-git-for-windows or another method to update git to its latest version? It will fix the issue.

    Feel free to reopen this issue if you are still having problems.

    just wanted to confirm this fixed my issue. upgraded git from 2.34.1.windows.1 to 2.54.0.windows.1 and text renders correctly

  15. Xgatt commented on May 23, 2026

    @Xgatt

    I was able to trace it to an issue with the old git version. Can you try running git update-git-for-windows or another method to update git to its latest version? It will fix the issue.

    Feel free to reopen this issue if you are still having problems.

    Confirming that this fixed it for me

  16. Chuangye-Wang commented on May 23, 2026

    @Chuangye-Wang

    I was able to trace it to an issue with the old git version. Can you try running git update-git-for-windows or another method to update git to its latest version? It will fix the issue.

    Feel free to reopen this issue if you are still having problems.

    Updating git to 2.54.0.windows.1 solved the issue. Thanks! @fcoury-oai

  17. adelfino69 commented on May 23, 2026

    @adelfino69
    Author

    Updating with git update-git-for-windows solved the issue. Thanks!

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

    TUIbugregressionwindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions