codex - 💡(How to fix) Fix Windows cmd.exe/conhost session can flip from TrueType font to raster Terminal while Codex CLI is running [1 participants]

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…
GitHub stats
openai/codex#19141Fetched 2026-04-24 06:00:03
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Participants
Timeline (top)
labeled ×4

On Windows 10, when running Codex CLI inside classic cmd.exe / conhost.exe (not Windows Terminal), the live console session can intermittently switch from a normal TrueType font (for example Consolas at ~20 px) to raster Terminal while Codex is still running.

This appears to be a runtime console-host font flip, not just bad saved console settings.

Root Cause

On Windows 10, when running Codex CLI inside classic cmd.exe / conhost.exe (not Windows Terminal), the live console session can intermittently switch from a normal TrueType font (for example Consolas at ~20 px) to raster Terminal while Codex is still running.

This appears to be a runtime console-host font flip, not just bad saved console settings.

Fix Action

Workaround

Externally reattach to the affected cmd.exe and call SetCurrentConsoleFontEx(...) to restore Consolas. Using Windows Terminal instead of classic cmd.exe / conhost.exe may also avoid this code path.

RAW_BUFFERClick to expand / collapse

Summary

On Windows 10, when running Codex CLI inside classic cmd.exe / conhost.exe (not Windows Terminal), the live console session can intermittently switch from a normal TrueType font (for example Consolas at ~20 px) to raster Terminal while Codex is still running.

This appears to be a runtime console-host font flip, not just bad saved console settings.

Environment

  • Codex CLI version: 0.122.0
  • Platform: Microsoft Windows 10.0.19045.6456 x64
  • Terminal: classic cmd.exe hosted by conhost.exe
  • Observed on: 2026-04-23

What happens

  • Codex starts normally in a readable TrueType font.
  • After some time in a normal interactive session, the same running cmd.exe window flips to raster Terminal.
  • When this happens, glyph quality visibly degrades and letters like C, D, X, Z look wrong/blocky.

Expected behavior

The active Codex session should keep using the configured TrueType console font for the lifetime of the session.

Actual behavior

The active Codex session intermittently switches to raster Terminal at runtime.

Local investigation

I instrumented the live cmd.exe console with Win32 console APIs:

  • The bad live Codex session reported:
    • FaceName = Terminal
    • FontSize = 12x8
    • FontFamily = 0x30
  • At the same time, the saved registry-backed console settings still reported the expected TrueType values:
    • HKCU\Console\FaceName = Consolas
    • FontFamily = 0x36
    • FontSize = 0x140000
    • FontWeight = 400
    • same for the main cmd.exe subkeys such as %SystemRoot%_System32_cmd.exe

So the failure is not just persisted registry drift. The running console session itself flips.

I also verified that an external helper can immediately repair the bad window in place by attaching to the affected cmd.exe and calling SetCurrentConsoleFontEx(...) back to Consolas 20 px.

Additional observations

  • I could not reproduce this immediately in every fresh throwaway cmd.exe + codex launch, so the trigger may be intermittent / session-lifetime related.
  • Simple title changes alone (title admin, spinner glyphs, UTF-8 code page) did not reproduce it in isolated tests.
  • Import inspection of the bundled native codex.exe showed normal console APIs such as CreateConsoleScreenBuffer, SetConsoleActiveScreenBuffer, SetConsoleMode, ReadConsoleW, WriteConsoleW, etc., but I did not see imports for SetCurrentConsoleFontEx / GetCurrentConsoleFontEx.

That makes this look more like a Codex TUI interaction with classic Windows console host state than an intentional explicit font change.

Possible relationship

This may be related to the broader set of Windows classic-console / conhost.exe issues already reported for Codex, for example legacy conhost.exe behavior in #12457, but this seems to be a separate symptom.

Reproduction status

Intermittent, but reproduced multiple times on the same machine on 2026-04-23 in a long-running Codex CLI session under classic cmd.exe / conhost.exe.

Workaround

Externally reattach to the affected cmd.exe and call SetCurrentConsoleFontEx(...) to restore Consolas. Using Windows Terminal instead of classic cmd.exe / conhost.exe may also avoid this code path.

extent analysis

TL;DR

The issue can be worked around by externally reattaching to the affected cmd.exe and calling SetCurrentConsoleFontEx to restore the Consolas font.

Guidance

  • Verify that the issue is indeed related to the Codex CLI interaction with the classic Windows console host state by checking the console font settings before and after the font flip.
  • Use the Windows Terminal instead of classic cmd.exe / conhost.exe to avoid this code path, if possible.
  • Investigate the Codex TUI code to see if there are any implicit or explicit console font changes that could be causing the issue.
  • Consider adding a periodic check for the console font and automatically restoring it to Consolas if it changes to Terminal.

Example

No code snippet is provided as the issue seems to be related to the interaction between Codex CLI and the Windows console host state, and the exact cause is still unknown.

Notes

The issue is intermittent and may be related to the broader set of Windows classic-console / conhost.exe issues already reported for Codex. The provided workaround may not be a permanent fix and further investigation is needed to determine the root cause.

Recommendation

Apply the workaround by externally reattaching to the affected cmd.exe and calling SetCurrentConsoleFontEx to restore Consolas, as this has been shown to immediately repair the bad window in place.

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…

FAQ

Expected behavior

The active Codex session should keep using the configured TrueType console font for the lifetime of the session.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING