Skip to content

Fix spaced-out terminal text on Windows (CJK-font cell sizing)#2287

Open
tomfluff wants to merge 1 commit into
garrytan:mainfrom
tomfluff:fix/windows-terminal-cjk-font
Open

Fix spaced-out terminal text on Windows (CJK-font cell sizing)#2287
tomfluff wants to merge 1 commit into
garrytan:mainfrom
tomfluff:fix/windows-terminal-cjk-font

Conversation

@tomfluff

Copy link
Copy Markdown

Problem

On Windows, the sidebar terminal (and the mono-font sidepanel UI) renders every character spaced out — C l a u d e C o d e instead of Claude Code. Screenshot of the symptom on a clean Windows 11 install: each glyph sits in a double-wide cell.

Cause

The xterm fontFamily and the --font-mono CSS var list only Mac/Linux monospace fonts (JetBrains Mono, SF Mono, Menlo, Fira Code, Cascadia Code) before the CJK fallbacks (Noto Sans Mono CJK KR, Malgun Gothic). None of the leading fonts ship with Windows, so the first font that actually resolves is Malgun Gothic — the Windows Korean UI font, present on every install. xterm.js sizes its character cell from the resolved font's advance width, and Malgun Gothic advances Latin glyphs in a full-width CJK cell, doubling every cell.

Fix

Insert Consolas (present on every Windows install) plus the Cascadia faces before the CJK fonts in both places. The CJK fonts stay last for genuine CJK glyph coverage. No bundled font, no user install.

  • extension/sidepanel-terminal.js — xterm fontFamily
  • extension/sidepanel.css--font-mono

Two lines of font-stack, verified on the affected Windows machine.

🤖 Generated with Claude Code

… the CJK fallbacks

On Windows none of the Mac/Linux monospace fonts in the stack are
installed, so the first font that resolves is Malgun Gothic (the Windows
Korean UI font). xterm.js sizes its character cell from that font's
advance width, and Malgun Gothic advances Latin glyphs in a full-width
CJK cell — doubling every cell and rendering the whole terminal (and the
sidepanel mono UI) as spaced-out text.

Insert Consolas (present on every Windows install) and the Cascadia
faces ahead of the CJK fonts in both the xterm fontFamily and the
--font-mono CSS var. The CJK fonts stay last for actual CJK coverage.
No bundled font, no user install needed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GKj8Nr8T4GvryTcWBJRMyC
@trunk-io

trunk-io Bot commented Jul 17, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant