Skip to content

TerminalFont (Ghostty): fix font-family fallback order - #2510

Merged
CarterLi merged 1 commit into
fastfetch-cli:devfrom
njkdev:fix-ghostty-font-fallback-order
Aug 13, 2026
Merged

TerminalFont (Ghostty): fix font-family fallback order#2510
CarterLi merged 1 commit into
fastfetch-cli:devfrom
njkdev:fix-ghostty-font-fallback-order

Conversation

@njkdev

@njkdev njkdev commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Ghostty treats repeated font-family as an ordered fallback list. The first entry is the primary, later entries are fallbacks for codepoints the primary lacks (docs). parseGhosttyConfig had this reversed: each entry overwrote the primary and demoted the previous one, so the last entry was reported as the terminal font.

Regression: 2.53.0–2.63.1 were correct (!fontName.length ? &fontName : &fontNameFallback, from #1972 for #1967). 2.64.0 rewrote the block to last-wins; #2448 carried that into the static parser.

Also handles font-family = "", which Ghostty documents as resetting the list.

Reproduction

Config:

font-family = TX-02-Variable
font-family = Menlo
font-family = Monaco
font-size = 14

Before: Terminal Font: Monaco (14pt) / Menlo
After: Terminal Font: TX-02-Variable (14pt) / Menlo

The primary font wasn't reordered, it was dropped. ghostty +show-config confirms the config order.

Only one fallback slot exists, so Monaco is still dropped. This is unchanged by this PR.

Testing

macOS 27.0, Ghostty 1.3.1, built from dev. Verified multiple entries, "" reset, and single-entry configs. Not tested on Linux or Windows; the change is in platform-independent parsing code.

Checklist

  • I have tested my changes locally.

@CarterLi
CarterLi merged commit 681749e into fastfetch-cli:dev Aug 13, 2026
4 of 23 checks passed
@njkdev
njkdev deleted the fix-ghostty-font-fallback-order branch August 13, 2026 05:13
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.

2 participants