codex - 💡(How to fix) Fix Windows TUI render corruption in git repos triggered by core.fsmonitor=false git metadata call

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…

Root Cause

This was bisected locally because the bug was initially suspected to be a Windows Terminal/Korean/resize issue. The bisection showed that Korean/IME and resize are amplifiers, not required root conditions.

Fix Action

Fix / Workaround

A local renderer patch in custom_terminal.rs that avoids redundant ClearToEnd on already-empty tail rows and hides the cursor earlier during frame flush mitigated the major symptoms in the same repro cases. That suggests the fsmonitor change is the trigger, while the persistent visual corruption is in the inline renderer/status redraw path.

Code Example

.args(["-c", "core.fsmonitor=false"])
RAW_BUFFERClick to expand / collapse

What version of Codex CLI is running?

Regression appears between 0.131.0-alpha.16 and 0.131.0-alpha.17.

Verified matrix:

  • 0.130.0: normal
  • 0.131.0-alpha.15: normal
  • 0.131.0-alpha.16: normal
  • a5040d0b3 (tui: split composer attachment and popup state): normal
  • 8736e3265 (tests: avoid ambient temp sandbox roots) + CLI compile fix: normal
  • 6ec8c4a6 (Ignore fsmonitor config in Git metadata reads) + CLI compile fix: reproduces
  • 6ec8c4a6 + CLI compile fix with only .args(["-c", "core.fsmonitor=false"]) removed: normal
  • 5a0296251: reproduces
  • 0.131.0-alpha.17, .19, .20, .21, .22: reproduce
  • 0.131.0, 0.132.0: reproduce

What subscription do you have?

Not relevant.

Which model were you using?

Observed in normal Codex TUI sessions; model does not appear relevant.

What platform is your computer?

Windows 11, PowerShell, Windows Terminal.

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

Windows Terminal.

What issue are you seeing?

In valid git repositories, the Codex CLI TUI can enter a persistent corrupted render state. Symptoms include:

  • prompt input text visually disappears while the text is still present internally
  • the working indicator/status text becomes clipped to one or two characters
  • bottom status line disappears or remains stale after session exit
  • cursor intermittently jumps to the next line/left edge during wraps
  • resize/streaming output, Korean/CJK text, and IME use make the issue easier to notice, but IME is not required
  • /resume does not reliably repair the visible TUI state

A key reproducer is that in a valid git repo, with no prompt typed, holding Backspace on an empty prompt can start corrupting the bottom status/prompt area. Non-git or invalid-git directories do not reproduce in the same environment.

Bisection result

The first triggering commit is 6ec8c4a6ecb17bc3ab10d0c5edf75494b50cab7e:

[codex] Ignore fsmonitor config in Git metadata reads (#22652)

The actual trigger is the single argument added in codex-rs/git-utils/src/info.rs:

.args(["-c", "core.fsmonitor=false"])

Evidence:

  • Previous commit 8736e3265 + same unrelated CLI compile fix: normal
  • 6ec8c4a6 + same compile fix: reproduces
  • 6ec8c4a6 + same compile fix, but with the core.fsmonitor=false line removed: normal

The CLI compile fix mentioned above is only the later plugin CLI compile fix touching:

  • codex-rs/cli/src/marketplace_cmd.rs
  • codex-rs/cli/src/plugin_cmd.rs

It was needed only to build intermediate commits and is not on the TUI/git path.

Interpretation

This does not look like core.fsmonitor=false directly corrupts the terminal. It appears to change internal git metadata subprocess invocation/timing enough to consistently exercise an existing inline TUI renderer weakness around bottom-pane/status redraw and terminal buffer synchronization.

A local renderer patch in custom_terminal.rs that avoids redundant ClearToEnd on already-empty tail rows and hides the cursor earlier during frame flush mitigated the major symptoms in the same repro cases. That suggests the fsmonitor change is the trigger, while the persistent visual corruption is in the inline renderer/status redraw path.

Related issues

This overlaps symptom-wise with, but is not the same as:

  • #15380 Windows Terminal scrollback/render inconsistency
  • #5576 output width remains truncated after resizing
  • #4870 Korean IME preedit blanks
  • #14372 git fsmonitor sandbox/IPC errors
  • #23446 /review branch picker regression where comments also mention 6ec8c4a6
  • #23367 wrong cwd regression, which #23446 was closed as duplicate of

The distinct part here is the minimized regression trigger: 6ec8c4a6 and specifically .args(["-c", "core.fsmonitor=false"]).

What steps can reproduce the bug?

One minimized local repro used:

  1. Windows Terminal + PowerShell.
  2. A minimal valid git repository/worktree.
  3. Codex TUI launched in that repo.
  4. No prompt input required; hold Backspace on an empty prompt, or resize/stream output in the same session.
  5. Observe prompt/status/footer rendering corruption.

A fake-git harness was also used to isolate the behavior from real repository content. Cases without a valid .git structure did not reproduce; valid git skeleton cases did.

What is the expected behavior?

Adding git -c core.fsmonitor=false ... to Codex's internal git metadata calls should not destabilize TUI rendering. Prompt input, status line, and streaming output should remain visible and correctly positioned across redraws, empty Backspace input, resize, and CJK/IME text.

Additional information

This was bisected locally because the bug was initially suspected to be a Windows Terminal/Korean/resize issue. The bisection showed that Korean/IME and resize are amplifiers, not required root conditions.

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 Windows TUI render corruption in git repos triggered by core.fsmonitor=false git metadata call