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.
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.
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
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
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:
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