Skip to content

Windows: repository-specific TUI escape-sequence leakage persists (like [A [201) still happens in codex-cli 0.145.0 #34587

Description

@BLueStarBLS

What version of Codex CLI is running?

Still appers in codex-cli v0.145.0

Also reproduced on:

  • codex-cli 0.144.6
  • codex-cli 0.144.4
  • codex-cli 0.144.5.
  • (Seems start from around 0.144.0)

What subscription do you have?

ChatGPT Plus

Which model were you using?

gpt-5.6-sol, gpt-5.6-terra
The issue occurs in the local TUI input handling before the model response, so it does not appear to be model-specific.

What platform is your computer?

Windows 11 x64

What terminal emulator and version are you using (if applicable)?

VS Code, PowerShell 7.6.3

Codex doctor report

Seems not related.

What issue are you seeing?

Codex intermittently enters a broken terminal input state.

Observed symptoms:

Image
  • Arrow keys insert literal text such as [A, [B, [C, [D
  • Right-click paste inserts bracketed-paste markers such as
    [200~<text>[201~
  • Some editing keys appear to insert or behave like spaces
  • The TUI becomes difficult or impossible to use

The problem may reappear when returning to the project the next day or
after several days of development.

What steps can reproduce the bug?

The problem is repository-specific:

  • It occurs in particular Git repository
  • Renaming or temporarily removing .git makes Codex work normally
  • Other projects do not reproduce the issue

Latest reproduction

Before running GC:

git count-objects -vH

count: 76
size: 756.11 KiB
in-pack: 2859
packs: 2
size-pack: 104.88 MiB
prune-packable: 0
garbage: 0
size-garbage: 0 bytes

Then ran:

git gc 

Afterwards:

git count-objects -vH

count: 0
size: 0 bytes
in-pack: 2935
packs: 2
size-pack: 105.01 MiB
prune-packable: 0
garbage: 0
size-garbage: 0 bytes

Restart Codex CLI, it will immediately worked normally again.

Also, possible to solve by rollback to 0.139.x.

This workaround has consistently resolved the issue each time it has
occurred.

An earlier reproduction had approximately 2900 loose objects and no pack
files. However, the latest reproduction occurred with only 76 loose
objects, so a large loose-object count does not appear to be required.

What is the expected behavior?

Codex should correctly process arrow keys, editing keys, focus events, and
bracketed paste regardless of Git repository state.

Additional information

This appears related to the issues described in:

#34029
#24929
#28301
#28869

In particular, #28301 describes ENABLE_VIRTUAL_TERMINAL_INPUT being
re-enabled after initialization.

Cannot determine whether Git operations are the root cause. The repository
state may instead change startup timing and expose an existing Windows TUI
input-mode race.

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLIIssues related to the Codex CLITUIIssues related to the terminal user interface: text input, menus and dialogs, and terminal displaybugSomething isn't workingwindows-osIssues related to Codex on Windows systems

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions