Skip to content

feat: terminal font family selector with Nerd Font support#272

Open
MonsieurBarti wants to merge 1 commit into
crynta:mainfrom
MonsieurBarti:feat/terminal-font-family
Open

feat: terminal font family selector with Nerd Font support#272
MonsieurBarti wants to merge 1 commit into
crynta:mainfrom
MonsieurBarti:feat/terminal-font-family

Conversation

@MonsieurBarti
Copy link
Copy Markdown

Summary

Adds a font family dropdown in Settings > Terminal so users can explicitly choose their terminal monospace font, including popular Nerd Font variants.

Motivation

Terax already auto-detects Nerd Fonts via document.fonts.check(), but this is unreliable in Tauri webviews — the font may not be registered in the document's font list at the time the terminal initializes, causing icons and glyphs to render as blank boxes or fallback characters. A manual selector guarantees the correct font is used.

Changes

  • New preference terminalFontFamily with options:
    • auto — preserves existing auto-detection behavior
    • jetbrains-mono-nerd, fira-code-nerd, meslo, hack, caskaydia, iosevka — Nerd Font variants
    • jetbrains-mono, sf-mono, menlo — standard monospace fonts
  • Proactive font loadingloadFontFamily() calls document.fonts.load() for the selected font before the terminal renders, eliminating the race condition that made check() unreliable
  • Live applicationapplyFontFamily() updates all open terminal slots immediately when the preference changes, no restart required
  • Settings UI — dropdown added in General > Terminal, between Font size and Scrollback

How to test

  1. Install any Nerd Font (e.g. brew install --cask font-jetbrains-mono-nerd-font)
  2. Open Terax Settings > Terminal
  3. Select the installed Nerd Font from the Font family dropdown
  4. Open a new terminal tab — powerline symbols and icons should render correctly
  5. Toggle back to Auto — should fall back to existing detection behavior

Checklist

  • pnpm exec tsc --noEmit passes
  • No Rust changes (no cargo clippy needed)
  • Follows branch naming convention (feat/terminal-font-family)

Adds a dropdown in Settings > Terminal to let users explicitly choose
their terminal font family, including popular Nerd Font variants.

- New preference terminalFontFamily (auto | JetBrainsMono Nerd Font |
  FiraCode Nerd Font | MesloLGS NF | Hack Nerd Font | CaskaydiaCove
  Nerd Font | Iosevka Nerd Font | JetBrains Mono | SF Mono | Menlo)
- Auto mode preserves existing auto-detection behavior
- Explicit selection bypasses document.fonts.check() flakiness in
  Tauri webviews and ensures the chosen font is loaded via
  document.fonts.load() before the terminal renders
- Applies live to all open terminal slots via applyFontFamily()
- Also loads the selected font proactively to avoid race conditions
  where check() returns false before the font is registered
@MonsieurBarti MonsieurBarti requested a review from crynta as a code owner May 15, 2026 22:15
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