Repository navigation
Allow themes to set the terminal font family (#3236) - #3479
Conversation
## Human comments ## What was wrong The integrated terminal always used a fixed font stack, so themes could change terminal colors but not the terminal font family. See [get-bb#3236](get-bb#3236). ## What changed Added `--font-terminal` with the existing terminal font stack as its default. The terminal reads it at construction and applies changes when the active theme changes, then refits after font updates or async font loading. The async font path forces xterm to remeasure its character cells and refresh its rows. Added tests and updated theming and configuration documentation. ## How you verified - Focused terminal tests: 28 passed - Theme tests: 30 passed - App typecheck passed - App lint passed with 0 errors - Production build passed - Live UI verification was unavailable because `dev-browser` could not run in the restricted environment Fixes get-bb#3236 > AGENT GENERATED
|
Thanks @0xferrous for the PR. This repo needs approval before a PR. Join the #contributors channel in Discord (https://discord.gg/kvBU6tJhcJ) and explain what you want to open a PR for and why. A maintainer then adds you to the allow list. This PR now closes on its own. Reopen it or open a new one after approval. |
|
i've tested it against local build, it worked AI Disclosure: I don't have much experience with frontend development, but I got gpt sol to review it and the changes from my perspective look fine, only thing I am less experienced to check is the xterm forced font measurement and fitting. I did however built the code and test it to verify that the terminal font customization applies. |
Human comments
What was wrong
The integrated terminal always used a fixed font stack, so themes could change terminal colors but not the terminal font family. See #3236. Fonts loaded through a delayed CSS import can arrive after the initial
document.fonts.readypromise resolves, and shared WebGL glyph caches can retain fallback glyphs when font loading leaves cell dimensions unchanged.What changed
Added
--font-terminalwith the existing terminal font stack as its default. The terminal reads it at construction and applies active-theme changes. A listener retained for each mounted terminal handles subsequent font loads, remeasures character cells, clears xterm's glyph atlas, and schedules a refit. Cleanup removes the listener and prevents pending callbacks from refreshing a disposed terminal. Updated theming and configuration documentation.How you verified
Fixes #3236