Skip to content

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

Closed

Description

@sy-yangpeng

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

Image

Activity

  1. added
    bug
    CLI
    windows-os
    TUI
    on May 20, 2026
  2. removed
    CLI
    on May 20, 2026
  3. fcoury-oai commented on May 22, 2026

    @fcoury-oai
    Contributor

    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.

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

    TUIbugwindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions