codex - 💡(How to fix) Fix Regression: Codex CLI 0.131.0-alpha.22 prints raw ANSI escape sequences in Windows TUI startup/resume

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Root Cause

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.

Fix Action

Fix / Workaround

Workarounds tried

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.

Code Example

codex-cli 0.131.0-alpha.22

---

codex-cli 0.131.0-alpha.9

---

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

---

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

---

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

---

[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 ...

---

codex --dangerously-bypass-approvals-and-sandbox

---

codex --dangerously-bypass-approvals-and-sandbox resume 019e20c6-4b39-7e43-9ce6-fb5bfc577c81

---

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

---

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
RAW_BUFFERClick to expand / collapse

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:

  • 170 commits between the tags.
  • Large TUI refactors touching startup/rendering/history cells/chatwidget/MCP startup.
  • plugin_hooks changed from under-development and disabled by default to stable and enabled by default in #22549.
  • There is also a recent MCP startup render-related change (#21624), which looks close to the affected surface.

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:

  • #22726: CLI TUI remains visually corrupted after stream disconnect
  • #22799: Windows/WSL startup/terminal detection hang
  • #22148: deprecated codex_hooks warning behavior
  • #9370: Windows terminal escape/keyboard handling issue

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.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING