Repository navigation
Preserve terminal font size when changing font family - #6958
Conversation
omarchy-font-set rewrote the Foot font line with a hardcoded size=9, silently undoing the size chosen by omarchy display text size. Now the existing :size=N is kept (falling back to 9 when absent), matching the behavior of kitty, alacritty, and ghostty. Fixes omacom#6957
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR updates omarchy-font-set to preserve Foot’s configured font size when changing font families, and adds a CLI test to prevent regressions.
Changes:
- Preserve
:size=in~/.config/foot/foot.iniwhen updating thefont=line, defaulting to 9 only if no size is present. - Add a hermetic-ish CLI test that validates font size preservation across Foot, Kitty, Alacritty, and Ghostty.
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| test/cli | Adds a regression test ensuring omarchy-font-set preserves terminal font sizes, especially Foot. |
| bin/omarchy-font-set | Changes Foot font update logic to keep existing :size= instead of hardcoding 9. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 2 changed files in this pull request and generated no new comments.
Suppressed comments (1)
test/cli:303
- This new test hard-fails when
fc-match/fc-list(fontconfig) isn’t available, which can make CI brittle on minimal images. Consider making the test conditional (skip when fontconfig tools aren’t present) or providing a deterministic, test-local fontconfig setup/stub so the test suite doesn’t depend on system packages to pass.
if command -v fc-match >/dev/null 2>&1; then
FONT_FAMILY="$(fc-match -f '%{family[0]}\n' monospace | head -1)"
else
FONT_FAMILY="$(fc-list :spacing=100 -f '%{family[0]}\n' | head -1)"
fi
if [[ -z $FONT_FAMILY ]]; then
fail "fontconfig has no resolvable monospace family for the font-set size test"
fi
Foot's font= takes a comma-separated fallback list, and the greedy match took the last :size= on the line, so a fallback's size replaced the one omarchy-display-text-size had set on the primary font. Co-Authored-By: Claude Opus 5.5 <[email protected]> Co-Authored-By: Codex Medium <[email protected]>
The test picked a family with fc-match under the real HOME and then had omarchy-font-set validate it with fc-list under the temporary one, so a font installed only in the user's home, or fontconfig with no fonts, failed the test for reasons unrelated to size. A fixed family answered by a stub makes it hermetic and removes the skip that reported as a pass. Co-Authored-By: Claude Opus 5.5 <[email protected]> Co-Authored-By: Codex Medium <[email protected]>
|
Reviewed and verified on a disposable Omarchy worker, and reviewed by Codex Medium as a second opinion. The bug is real. On a stock install, Two fixes pushed to your branch:
Tests: Second opinion: Codex Medium found the fallback-list and host-font problems above. Its second round, on ff6cacf, found nothing left open. Its independence from this review is not guaranteed. Related: this fixes #6957. #11487 also stops Waiting on the maintainer. |
omacom#6958 made font-set keep the primary foot font's size instead of resetting it to 9, and this branch now writes the family escaped. Its size lookup stopped at the first comma, so a family with an escaped comma lost its size; read up to the first unescaped comma instead. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Since omacom#6958, font-set keeps the primary foot font's size instead of writing 9. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The one conflict was bin/omarchy-font-set, where omacom#6958 now preserves foot's existing font size. Kept that and put --follow-symlinks on its sed -i, so a symlinked foot.ini stays linked as the rest of this branch intends. No other bare sed -i arrived with the merge.
* Preserve terminal font size when changing font family omarchy-font-set rewrote the Foot font line with a hardcoded size=9, silently undoing the size chosen by omarchy display text size. Now the existing :size=N is kept (falling back to 9 when absent), matching the behavior of kitty, alacritty, and ghostty. Fixes omacom#6957 * Resolve the test font deterministically via fc-match * Harden font size test for minimal environments * Keep the primary Foot font's size when the line lists fallbacks Foot's font= takes a comma-separated fallback list, and the greedy match took the last :size= on the line, so a fallback's size replaced the one omarchy-display-text-size had set on the primary font. Co-Authored-By: Claude Opus 5.5 <[email protected]> Co-Authored-By: Codex Medium <[email protected]> * Stub fc-list in the font-set size test The test picked a family with fc-match under the real HOME and then had omarchy-font-set validate it with fc-list under the temporary one, so a font installed only in the user's home, or fontconfig with no fonts, failed the test for reasons unrelated to size. A fixed family answered by a stub makes it hermetic and removes the skip that reported as a pass. Co-Authored-By: Claude Opus 5.5 <[email protected]> Co-Authored-By: Codex Medium <[email protected]> --------- Co-authored-by: David Heinemeier Hansson <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: Codex Medium <[email protected]> (cherry picked from commit 09ed48f)
What
omarchy font set <name>(and the settings-menu Style → Font picker) now swaps only the font family and keeps the existing terminal size. Foot previously had its size hardcoded back to 9pt on every family change, silently undoing the size chosen viaomarchy display text sizeor the display-panel slider.Why
The Foot branch of
bin/omarchy-font-setrewrote the wholefont=line with a hardcoded:size=9:kitty, alacritty, and ghostty only get their family line rewritten, so they keep their size. Foot was the inconsistent outlier — the font picker in the GUI silently reset Foot's text size to 9 while everything else stayed scaled.
Change
bin/omarchy-font-set: read the existing:size=Nfrom foot.ini and reuse it when swapping the family; fall back to 9pt when no size is present.test/cli: regression test covering Foot plus the three other terminals, using the harness's fake-bin pattern to stay hermetic.Verification
:size=12across a family change, matching kitty/alacritty/ghostty../test/all: CLI suite fully green including the new tests. The only shell-suite failures are the pre-existingomarchy-pkgscheckout-dependent tests (config-test, snapper-test, unowned-system-paths-test), which fail identically on unmodifiedorigin/quattroin this environment.Fixes #6957