Bug: raw ANSI control sequences in Windows interactive CLI when cwd is a Git repo (``), but not when `.git` is removed

Resolved 💬 2 comments Opened May 20, 2026 by sy-yangpeng Closed May 22, 2026
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

### 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:

```bash
codex.cmd --no-alt-screen

  1. Observe raw terminal control sequences such as and broken interactive rendering.
  2. Move the repo's .git directory out of the folder and run the same command again.
  3. 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" />

View original on GitHub ↗

2 Comments

github-actions[bot] contributor · 3 months ago

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

  • #23628
  • #23031
  • #23512

Powered by Codex Action

fcoury-oai contributor · 3 months 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.