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

Resolved 💬 18 comments Opened May 16, 2026 by adelfino69 Closed May 22, 2026
💡 Likely answer: A maintainer (fcoury-oai, contributor) responded on this thread — see the highlighted reply below.

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.

View original on GitHub ↗

18 Comments

fcoury-oai contributor · 2 months ago

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

adelfino69 · 2 months ago

it/s difficult to do it, this what I see

On Sat, 16 May 2026 at 19:44, Felipe Coury @.***> wrote:

fcoury-oai left a comment (openai/codex#23031) <https://github.com/openai/codex/issues/23031#issuecomment-4467648517> Could you run a /feedback in one of your sessions? — Reply to this email directly, view it on GitHub <https://github.com/openai/codex/issues/23031#issuecomment-4467648517>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AH5C3J5OGWX7SWL5IGYB4MD43CSHJAVCNFSM6AAAAACZAS5EUOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHM2DINRXGY2DQNJRG4> . Triage notifications on the go with GitHub Mobile for iOS <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>. You are receiving this because you authored the thread.Message ID: @.***>

--
Warning Notice
The information contained in this communication and any documents
transmitted with it are confidential, may be privileged and are intended
solely for the use of the intended recipient. If you are not the addressee
any copying, retransmission, distribution, action taken, or omitted to be
taken in reliance upon it is strictly prohibited and may be unlawful. If
you have received this communication in error please notify us immediately
by e-mail and delete it from your system and destroy any copies of it.

Avviso
Le informazioni contenute in questo messaggio di posta elettronica sono
riservate e confidenziali e ne e' vietata la diffusione in qualunque modo
eseguita.
Qualora Lei non fosse la persona cui il presente messaggio e' destinato, e'
invitata a non diffonderlo, e ad eliminarlo, dandone gentilmente
comunicazione al mittente.

fcoury-oai contributor · 2 months ago

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

 codex doctor --all
adelfino69 · 2 months ago

PS E:\gis2025\gisSolution\Projects\Development\gis> codex doctor --all
Codex Doctor v0.131.0-alpha.22 · windows-x86_64

Notes
⚠ rollouts 1,695 active files · 3.52 GB on disk
⚠ sandbox filesystem restricted · network enabled
⚠ install npm-managed launch could not inspect npm global root
⚠ updates npm update target could not be inspected
─────────────────────────────────────────────────────────────

Environment
✓ runtime npm
version 0.131.0-alpha.22
install method npm
commit unknown
executable
@.****@.\codex-win32-x64\vendor\x86_64-pc-windows-msvc\codex\codex.exe
⚠ install npm-managed launch could not inspect npm global root
context npm
managed by npm: yes · bun: no · package root
@.*\codex
PATH entries (4) C:\Program Files\nodejs\codex
C:\Program Files\nodejs\codex.cmd
C:\Users\Utente\AppData\Roaming\npm\codex
C:\Users\Utente\AppData\Roaming\npm\codex.cmd
npm root -g failed program not found
✓ search ripgrep 15.1.0 (rev af60c2de9d) (system, rg.exe)
search command rg.exe
search provider system
search command readiness ripgrep 15.1.0 (rev af60c2de9d)
✓ terminal Windows Terminal
terminal Windows Terminal
stdin is terminal true
stdout is terminal true
stderr is terminal true
terminal size 156x41
color output enabled
WT_SESSION present
✓ state databases healthy
CODEX_HOME C:\Users\Utente\.codex (dir)
log dir C:\Users\Utente\.codex\log (dir)
sqlite home C:\Users\Utente\.codex (dir)
state DB C:\Users\Utente\.codex\state_5.sqlite (file)
· integrity ok
log DB C:\Users\Utente\.codex\logs_2.sqlite (file)
· integrity ok
active rollouts 1,695 files · 3.52 GB (avg 2.13 MB)
archived rollouts 2 files · 121.25 KB (avg 60.63 KB)

Configuration
✓ config loaded
model gpt-5.5 · openai
cwd
E:\gis2025\gisSolution\Projects\Development\gis
config.toml C:\Users\Utente\.codex\config.toml
config.toml parse ok
MCP servers 2
feature flags 34 enabled · 7 overridden
overrides unified_exec, memories, request_rule,
external_migration, mentions_v2, goals, prevent_idle_sleep
enabled flags shell_tool, unified_exec, shell_snapshot,
terminal_resize_reflow, sqlite, memories, hooks, request_rule,
enable_request_compression, multi_agent, apps, tool_search, tool_suggest,
plugins, plugin_hooks, in_app_browser, browser_use, browser_use_external,
computer_use, plugin_sharing, external_migration, image_generation,
skill_mcp_dependency_install, mentions_v2, steer, guardian_approval, goals,
collaboration_modes, tool_call_mcp_elicitation, personality, fast_mode,
tui_app_server, prevent_idle_sleep, workspace_dependencies
✓ auth auth is configured
auth storage mode File
auth file C:\Users\Utente\.codex\auth.json
stored auth mode chatgpt
stored API key false
stored ChatGPT tokens true
stored agent identity false
✓ mcp 2 server (1 stdio, 1 streamable_http) · 0 disabled
configured servers 2
disabled servers 0
stdio servers 1
streamable_http servers 1
✓ sandbox restricted fs + enabled network · approval OnRequest
approval policy OnRequest
filesystem sandbox restricted
network sandbox enabled
linux helper none
execve wrapper helper none

Updates
⚠ updates npm update target could not be inspected
startup update check true
update action npm install -g @openai/codex
version cache C:\Users\Utente\.codex\version.json
cached latest version 0.130.0
last checked at 2026-05-16 06:26 UTC
npm root -g failed program not found
latest version 0.130.0
latest version status current version is not older

Connectivity
✓ network no proxy env vars
proxy env vars none
✓ websocket connected (HTTP 101 Switching Protocols) · 15s timeout
model provider openai
provider name OpenAI
wire API responses
supports websockets true
proxy env vars none
connect timeout 15000 ms
auth mode chatgpt
endpoint wss://chatgpt.com/backend-api/<redacted>
DNS 2 IPv4, 0 IPv6, first IPv4
handshake result HTTP 101 Switching Protocols
reasoning header false
models etag present true
server model present false
✓ reachability active provider endpoints are reachable over HTTP
reachability mode ChatGPT auth
ChatGPT base URL https://chatgpt.com/backend-api/ reachable
(HTTP 403)

Background Server
○ app-server not running (ephemeral mode)
daemon state dir C:\Users\Utente\.codex\app-server-daemon
settings
C:\Users\Utente\.codex\app-server-daemon\settings.json (missing)
pid file
C:\Users\Utente\.codex\app-server-daemon\app-server.pid (missing)
update-loop pid file
C:\Users\Utente\.codex\app-server-daemon\app-server-updater.pid (missing)
control socket
C:\Users\Utente\.codex\app-server-control\app-server-control.sock
status not running
mode ephemeral

─────────────────────────────────────────────────────────────
11 ok · 1 idle · 4 notes · 2 warn · 0 fail degraded

--summary compact output --all expand truncated lists
--json redacted report

On Sat, 16 May 2026 at 20:03, Felipe Coury @.***> wrote:

fcoury-oai left a comment (openai/codex#23031) <https://github.com/openai/codex/issues/23031#issuecomment-4467697491> Thanks, can you instead run this with alpha.22 and send me the output? codex doctor --all — Reply to this email directly, view it on GitHub <https://github.com/openai/codex/issues/23031#issuecomment-4467697491>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AH5C3J7BDDCIYBXEA2A4J6T43CUQNAVCNFSM6AAAAACZAS5EUOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHM2DINRXGY4TONBZGE> . Triage notifications on the go with GitHub Mobile for iOS <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>. You are receiving this because you authored the thread.Message ID: @.***>

--
Warning Notice
The information contained in this communication and any documents
transmitted with it are confidential, may be privileged and are intended
solely for the use of the intended recipient. If you are not the addressee
any copying, retransmission, distribution, action taken, or omitted to be
taken in reliance upon it is strictly prohibited and may be unlawful. If
you have received this communication in error please notify us immediately
by e-mail and delete it from your system and destroy any copies of it.

Avviso
Le informazioni contenute in questo messaggio di posta elettronica sono
riservate e confidenziali e ne e' vietata la diffusione in qualunque modo
eseguita.
Qualora Lei non fosse la persona cui il presente messaggio e' destinato, e'
invitata a non diffonderlo, e ad eliminarlo, dandone gentilmente
comunicazione al mittente.

fcoury-oai contributor · 2 months ago

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

adelfino69 · 2 months ago

I already sent to you, thi more complete
when I do codex in a folder

On Sat, 16 May 2026 at 22:41, Felipe Coury @.***> wrote:

fcoury-oai left a comment (openai/codex#23031) <https://github.com/openai/codex/issues/23031#issuecomment-4468049123> Would you mind sending a screenshot of the issue as well? — Reply to this email directly, view it on GitHub <https://github.com/openai/codex/issues/23031#issuecomment-4468049123>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AH5C3J27CQGDESQVRFBJENT43DG6ZAVCNFSM6AAAAACZAS5EUOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHM2DINRYGA2DSMJSGM> . Triage notifications on the go with GitHub Mobile for iOS <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>. You are receiving this because you authored the thread.Message ID: @.***>

--
Warning Notice
The information contained in this communication and any documents
transmitted with it are confidential, may be privileged and are intended
solely for the use of the intended recipient. If you are not the addressee
any copying, retransmission, distribution, action taken, or omitted to be
taken in reliance upon it is strictly prohibited and may be unlawful. If
you have received this communication in error please notify us immediately
by e-mail and delete it from your system and destroy any copies of it.

Avviso
Le informazioni contenute in questo messaggio di posta elettronica sono
riservate e confidenziali e ne e' vietata la diffusione in qualunque modo
eseguita.
Qualora Lei non fosse la persona cui il presente messaggio e' destinato, e'
invitata a non diffonderlo, e ad eliminarlo, dandone gentilmente
comunicazione al mittente.

runfence · 2 months ago
dano1066 · 2 months ago

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

adelfino69 · 2 months ago

I have upgrade to 0.132 but the problem remain same as the bug open.

Chuangye-Wang · 2 months ago

Same issue with v0.132.0 version.

adelfino69 · 1 month ago

Same issue with v0.133.0 version

fcoury-oai contributor · 1 month ago

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.

runfence · 1 month ago

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

fcoury-oai contributor · 1 month ago

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

nikkelly · 1 month ago
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

Xgatt · 1 month ago
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

Chuangye-Wang · 1 month ago
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

adelfino69 · 1 month ago

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