TerminalFont (Ghostty): parse config files statically instead of exec'ing ghostty +show-config#2448
Open
clicelee wants to merge 1 commit into
Open
Conversation
…'ing `ghostty +show-config` (fastfetch-cli#2122)
Contributor
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
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
detectGhostty()currently execsghostty +show-config, which spawns the full ghostty binary — 42–262ms per run on an M-series Mac (2s+ on a cold first exec), making the terminalfont module by far the slowest one. This PR returns to static config file parsing, but now followsconfig-filedirectives, matching ghostty's documented/implemented semantics (verified againstloadRecursiveFiles()in ghostty'sConfig.zig).Timings (real Ghostty 1.3.1 window,
--stat, macOS; the exec cost varies a lot run-to-run):config-fileincludes)Related issue (required for new logos for new distros)
Closes #2122
Changes
config-fileincludes are queued and parsed after all root files, in discovery order (breadth-first, same as ghostty)?optional prefix supported; missing files are skipped+show-configexec path entirelyfont-sizewas parsed and then overwritten with an empty buffer in the static (Muxy) pathScreenshots
The run captured below hit 261.9ms on the exec path; detection output is identical before/after.
Worst case with 16 chained
config-fileincludes — still under 1ms, same detection result (Fira Code (13pt)) from both implementations:Checklist