feat: terminal font family selector with Nerd Font support#272
Open
MonsieurBarti wants to merge 1 commit into
Open
feat: terminal font family selector with Nerd Font support#272MonsieurBarti wants to merge 1 commit into
MonsieurBarti wants to merge 1 commit into
Conversation
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
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.
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
terminalFontFamilywith options:auto— preserves existing auto-detection behaviorjetbrains-mono-nerd,fira-code-nerd,meslo,hack,caskaydia,iosevka— Nerd Font variantsjetbrains-mono,sf-mono,menlo— standard monospace fontsloadFontFamily()callsdocument.fonts.load()for the selected font before the terminal renders, eliminating the race condition that madecheck()unreliableapplyFontFamily()updates all open terminal slots immediately when the preference changes, no restart requiredHow to test
brew install --cask font-jetbrains-mono-nerd-font)Checklist
pnpm exec tsc --noEmitpassescargo clippyneeded)feat/terminal-font-family)