Repository navigation
Conversation
Ghostty treats a repeated `font-family` as a fallback chain: the first entry is the primary face and the rest are fallbacks. The mapper flattens repeated keys with `rawValue.at(-1)`, which is the right default for keys where a later line overrides an earlier one, but for font-family it imported the least-preferred face — `Menlo` then `Monaco` arrived as `Monaco`. The parser was already correct; it preserves repeats as a string[]. Read that unflattened value in the font-family handler and take the first usable entry, the same way `palette` already reads its own repeats via the second handler argument. Scope: this only changes which single face is imported. Turning terminalFontFamily into a fallback stack is stablyai#8428's territory. Fixes stablyai#15985
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughUpdated Merge Risk: ⚪ Minimal · up to This localized import fix selects the first non-empty font-family entry while leaving other configuration behavior unchanged. No actionable merge-blocking risk remains after normal checks and review. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Description checkExplanation The description follows the repository template and explains the behavior, rationale, linked issue, testing, scope, AI disclosure, and checklist status. It correctly marks visual proof as not applicable.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: e8f0f44e-ed84-4a60-9494-0991b0e09165
📒 Files selected for processing (2)
src/main/ghostty/mapper.test.tssrc/main/ghostty/mapper.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
| 'font-family': (v, rawValue) => { | ||
| const first = Array.isArray(rawValue) ? rawValue.find((entry) => entry.trim().length > 0) : v | ||
| if (typeof first !== 'string' || first.trim().length === 0) { | ||
| return null | ||
| } | ||
| return { key: 'terminalFontFamily', value: v } | ||
| return { key: 'terminalFontFamily', value: first } |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Allow trailing blank entries to reach the font-family parser.
When rawValue is ['Fira Code', ' '], the loop uses the last entry as value. Line 295 then marks the key unsupported before this parser runs. The valid primary font is lost. Skip the generic blank check for font-family; this parser already returns null when all entries are blank. Add a regression test for a trailing blank entry.
Proposed fix
- if (!value.trim()) {
+ if (key !== 'font-family' && !value.trim()) {
unsupportedKeys.push(key)
continue
}…ing value Ghostty documents an empty value on a repeatable key as resetting the list, so a config ending in `font-family = ` has cleared its fonts deliberately. Importing the earlier entry would resurrect a font the user removed. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Greptile SummaryThe PR corrects Ghostty font-family import behavior while preserving reset semantics.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| src/main/ghostty/mapper.ts | The mapper now selects the first nonblank font after the final reset, fully addressing the previously reported reset-boundary issue. |
| src/main/ghostty/mapper.test.ts | Tests cover ordinary fallback chains and the leading, middle, and trailing blank-entry cases relevant to reset behavior. |
Reviews (2): Last reviewed commit: "fix(ghostty): honor the font-family rese..." | Re-trigger Greptile
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 53fea7eb-12b4-41f6-9709-a2f038f48117
📒 Files selected for processing (1)
src/main/ghostty/mapper.test.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.
…rimary face An empty entry in a repeated font-family resets the list, so only the entries after the last reset are still in effect. Searching the whole array imported a face the config had explicitly cleared -- `['Fira Code', '', 'Monaco']` yielded Fira Code instead of Monaco. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Thank you @maxmilian for tracking this down! The fix landed in #37292 (same first-entry-after-reset approach, plus fallback reporting and cross-file lists), so I'm closing this in favor of it. |
ELI5
Ghostty lets you list
font-familymore than once — the first one is the font you want, the rest are backups for characters the first one doesn't have. When importing that config, Orca kept the last one instead of the first, so you ended up with your backup font as your main font.What Changed
One handler in
src/main/ghostty/mapper.ts. Thefont-familyhandler now reads the unflattened value and takes the first non-empty entry, instead of receiving the already-flattened "last occurrence" string.Two test cases added to the existing
src/main/ghostty/mapper.test.ts.Why
The parser was never the problem —
parseGhosttyConfigalready preserves repeated keys correctly as astring[]. The value is lost one layer up, in the mapper's generic flattening:That default is right for most Ghostty keys, where a later line genuinely overrides an earlier one.
font-familyis one of the repeatable keys where it isn't: the first entry is the primary face and the rest are the fallback chain, so.at(-1)picks the least-preferred face.Why this approach: handlers already receive the unflattened value as their second argument (
parser(value, rawValue)), andpalettealready uses exactly that to read all of its own repeats. So this needs no new mechanism and no change to the shared flattening — it reuses the escape hatch the mapper already has, and leaves every other key's behavior untouched.Scope, deliberately narrow: this only changes which single face is imported. Turning
terminalFontFamilyinto a real fallback stack is #8428's territory, and I did not want to collide with it. This change should merge cleanly either way.Linked Issue
Fixes #15985
Visual Proof
N/A— there is no UI or interaction change. This is a pure config-parsing fix in the main process; the only observable difference is which font name lands interminalFontFamilyafter importing a Ghostty config. That difference is asserted directly in the tests below rather than shown as pixels.Testing
Red-first, against the exact case in the issue. Added to
src/main/ghostty/mapper.test.ts:keeps the first font-family when the key is repeated—['Menlo', 'Monaco']must import asMenloskips blank entries when picking the first font-family—[' ', 'Fira Code', 'Monaco']must import asFira CodeBoth fail on
mainbefore the change (expected 'Monaco' to be 'Menlo'/expected 'Monaco' to be 'Fira Code') and pass after. Full ghostty suite: 7 files, 151 tests passed.Local gates, all on node 24.19.0 / pnpm 10.24.0:
pnpm typecheckpnpm lintpnpm testpnpm buildOne pre-existing failure in the full run, not from this change:
src/relay/git-handler-fork-remote-exec.test.ts > adds and removes the fork remoteexpectshttps://github.com/...but getsgit@github.com:.... I verified it by stashing this diff and re-running on a clean tree — it fails identically there. It's my local gitinsteadOfconfig rewriting HTTPS remotes to SSH, not something this PR touches.Platform tested: macOS (Apple Silicon). See Notes on why the other platforms don't need separate coverage here.
AI Disclosure
Written with Claude Code (Claude Opus 5). I traced the root cause, chose the approach, and verified every claim above myself — the red-before/green-after runs and the clean-tree control run for the pre-existing failure were all executed locally, not assumed.
Review
AI code review summary, per CONTRIBUTING:
terminalFontFamilyis a terminal appearance setting; no agent, MCP, or integration surface reads or writes it here..find()over the entries of one config key, bounded by how many times a user wrotefont-familyin their config (realistically ≤ 5). Strictly cheaper than the.at(-1)path it bypasses in no meaningful way, and it runs once per import, not per frame or per keystroke.font-familyconfig keep their current setting until they re-import — this changes import behavior, not stored settings, so nothing is silently rewritten under them. Single-font-familyconfigs (the overwhelming majority) are completely unaffected: the non-array branch is unchanged.Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
Covered in Review above: no security surface, no platform-conditional code, no SSH/remote path, no mobile surface, no agent/integration contract, negligible performance cost, and import-only behavior change with no silent rewrite of existing settings.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)