[Feature Request] Terminal: Nerd Font glyphs render as boxes — bundle Symbols Nerd Font fallback (or make font configurable)
- Dominant language
- Rust
- Stars
- 32.7k
- Forks
- 4.3k
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 253
Description
**Motivation**
Anyone using a Nerd Font–based shell prompt (oh-my-posh, powerlevel10k, starship presets) sees broken glyphs in the embedded terminal: powerline separators and icons render as placeholder boxes, since those glyphs live in the Unicode Private Use Area (PUA).
Root cause, from reading the source:
- The terminal is a custom canvas renderer with a hardcoded font stack: `14px "JetBrains Mono", monospace` (`desktop/src/features/terminal/terminalRenderer.ts`, `TERMINAL_CELL_METRICS`).
- JetBrains Mono is bundled via `@fontsource/jetbrains-mono` (`desktop/src/main.tsx`), whose `@font-face` rules declare `unicode-range` subsets (latin, latin-ext, cyrillic, …) that do **not** cover the PUA.
- For PUA codepoints the browser therefore skips the bundled faces and falls through to the generic `monospace` WebKit default, which has no glyphs there either → tofu boxes.
Because the family name is pinned and shadowed by the bundled `@font-face`, installing a Nerd Font on the system (e.g. JetBrainsMono Nerd Font or Meslo NF) does not help — there is currently no way for users to fix this on their end other than switching their prompt to an ASCII-only theme inside Buzz (via `TERM_PROGRAM=Buzz` detection in their shell rc).
**Proposed solution**
Bundle the symbols-only [Symbols Nerd Font](https://github.com/ryanoasis/nerd-fonts/tree/master/patched-fonts/NerdFontsSymbolsOnly) (`SymbolsNerdFontMono-Regular.ttf`, ~2500 glyphs, small) and add it as a fallback in the terminal font stack:
```ts
font: '14px "JetBrains Mono", "Symbols Nerd Font Mono", monospace',
boldFont: '700 14px "JetBrains Mono", "Symbols Nerd Font Mono", monospace',
```
Latin text keeps rendering in JetBrains Mono exactly as today; only the PUA glyphs resolve to the symbols font. Cell metrics are unaffected since the renderer already paints per-cell. This is the same approach VS Code-adjacent terminals and Zed use for prompt glyph coverage.
**Alternatives considered**
- A user-configurable terminal font family setting (would also resolve #3938's sibling concern about font size; more surface area, but strictly more flexible).
- Not shadowing system fonts: dropping the pinned family for PUA ranges doesn't work, since WebKit's system fallback deliberately does not scan installed fonts for PUA codepoints.
- Doing nothing: users must detect `TERM_PROGRAM=Buzz` in their shell rc and switch to an ASCII-only prompt theme — works, but every Nerd Font prompt user hits this wall on first use.
**Additional context**
- Related: #3938 (adjustable font/text size in Buzz Desktop) — same hardcoded metrics constant.
- Duplicate search for "nerd font" / "terminal font" in open issues and PRs: none found.
- Happy to send a PR for the symbols-fallback approach if that direction is acceptable.
Contributor guide
Research direction
Start with desktop/src/features/terminal/terminalRenderer.ts and its TERMINAL_CELL_METRICS font definitions, then inspect the JetBrains Mono setup in desktop/src/main.tsx. Verify how the bundled font assets are loaded and how the renderer handles font fallback. Done means Nerd Font PUA icons render in the embedded terminal while Latin text and existing cell metrics remain unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cli, desktop
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 72/100