Repository navigation
feat(tui): warn when a raster-font console cannot display Unicode - #287
Merged
Merged
Conversation
Legacy conhost windows using a raster font can only draw OEM code page characters: the display best-fit converts everything else to "?" at draw time, so Vietnamese/CJK text looks corrupted even though the underlying data is correct. Detect that configuration at startup (win32 TTY, no WT_SESSION/TERM_PROGRAM/TERM, console font without TMPF_TRUETYPE) and show a one-shot warning toast pointing users at Windows Terminal or a TrueType console font. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
quickbeard
force-pushed
the
conhost-warning
branch
from
August 24, 2026 02:50
f50bd37 to
3d1fff0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Windows users running CoDev Code in a legacy console window (classic conhost, e.g. a plain "Windows PowerShell" window) with a raster font reported Vietnamese text showing "font errors": characters outside the OEM code page render as
?(lỗi→l?i), with best-fit substitutions for some letters (đ→d,ư→u). This happens at conhost's draw time — raster fonts can only display OEM code page characters (chcp docs, SetConsoleOutputCP remarks) — so both the user's prompt and the model's response look corrupted even though the app writes correct UTF-8 and the underlying data is fine. The app cannot fix the rendering; today it corrupts silently and users blame the app or the model.Change
packages/tui/src/terminal-win32.ts: newwin32RasterFontConsole()export using kernel32GetCurrentConsoleFontExthrough the existing dlopen table. Returns true only when stdout is a win32 TTY, none ofWT_SESSION/TERM_PROGRAM/TERMare set (conhost sets none of these; Windows Terminal, VS Code, mintty, and ssh sessions each set one, so modern hosts that render Unicode fine are skipped regardless of the font they report), and the current console font lacksTMPF_TRUETYPE.packages/tui/src/app.tsx: anonMountbeside the other startup toasts shows a one-shot warning when the check fires, telling the user to run CoDev Code in Windows Terminal or switch the console font to a TrueType font such as Consolas.DIVERGENCES.md: row for both upstream-file edits.Testing
bun typecheckinpackages/tuipasses.bun testinpackages/tui: 265 pass, 1 skip, 0 fail.🤖 Generated with Claude Code