Repository navigation
Conversation
The terminal is its own iframe document and deliberately loads no global.css, which is where every bundled @font-face lived. Inside the terminal a name like "Google Sans Code" therefore matched nothing and the family list fell through to ui-monospace: SF Mono on macOS, so the font picker silently had no effect there, and on Linux (WebKitGTK) a proportional font, drawn into fixed-width cells with gaps between the characters. Move the @font-face rules to styles/fonts.css, imported by global.css and by the terminal page. Fetch the chosen font before xterm measures its cells, at startup and when the setting changes, since the rules use font-display: swap and nothing else requests the font first.
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.
The terminal is its own iframe document (
pages/vm/terminal.astro) and deliberately loads noglobal.css, which is where every bundled@font-facelived. Inside the terminal, a name like"Google Sans Code"matched nothing and the family list fell through toui-monospace:Changes:
@font-facerules tostyles/fonts.css, imported byglobal.cssand by the terminal page.font-display: swap, so nothing requests the font before the terminal needs it.The terminal page's CSP already allows
font-src 'self'.Tests. New
terminal-fonts.test.ts(4 tests): every bundled font in the picker is declared infonts.css, the terminal page imports it, and the font is requested before use.astro buildsucceeds and the builtvm/terminal/index.htmlcontains the font rules.With the settings mock generated (
build_system/scripts/build/check-generated-settings.sh),vitest runpasses (82 files, 705 tests; main is 81 files, 701 tests) andpnpm run checkreports 0 errors and 0 warnings.Verified on Linux (WebKitGTK 2.54) with a build of main plus this commit, on a machine where
ui-monospaceresolves to a proportional font: the terminal renders in the selected monospace font.🤖 Generated with Claude Code