codex - 💡(How to fix) Fix Bug: raw ANSI control sequences in Windows interactive CLI when cwd is a Git repo (``), but not when `.git` is removed

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

What version of Codex is running?

codex-cli 0.132.0

Which model were you using?

Observed in the interactive CLI before normal use; model choice does not appear relevant.

What platform is your computer?

Windows (reproduced in native PowerShell and cmd.exe)

What issue are you seeing?

When I start the interactive Codex CLI inside a normal Git repository on Windows, the TUI prints raw ANSI / terminal control sequences such as `` and becomes unusable.

The issue appears to depend on the current directory being recognized as a Git repo:

  • If I run Codex in a folder with a .git directory, the interactive UI breaks.
  • If I move the .git directory out of that same folder, Codex starts rendering normally again.

This reproduces in at least two unrelated repositories, so it does not appear to be specific to one project.

What steps can reproduce the bug?

  1. Use codex-cli 0.132.0 on Windows.
  2. Open cmd.exe or PowerShell.
  3. cd into a normal Git repository.
  4. Run:
    codex.cmd --no-alt-screen
  5. Observe raw terminal control sequences such as and broken interactive rendering.
  6. Move the repo's .git directory out of the folder and run the same command again.
  7. Observe that the UI renders normally.

What is the actual behavior?

In Git repositories, the interactive TUI prints raw control sequences and becomes unusable. Removing .git from the same folder makes the problem disappear.

Additional information

  • Reproduced in multiple unrelated repos (for example, cloned Sentinel and RuoYi-Cloud).
  • git status works normally in the affected repos, so the repositories themselves do not appear corrupted.
  • --no-alt-screen does not fix the problem.
  • This looks more like a Windows interactive TUI / Git-repo detection / terminal refresh compatibility issue than a repository-content issue.
  • Possibly related issues:
    • #12542
    • #22085
<img width="913" height="203" alt="Image" src="https://github.com/user-attachments/assets/af0c16aa-3008-4158-8b56-a65470564e2e" />

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

codex - 💡(How to fix) Fix Bug: raw ANSI control sequences in Windows interactive CLI when cwd is a Git repo (``), but not when `.git` is removed