Skip to content

Preserve terminal font size when changing font family - #6958

Merged
omarchybot merged 5 commits into
omacom:quattrofrom
sbalbalosa:fix/font-set-preserve-foot-size
Oct 31, 2026
Merged

omarchybot merged 5 commits into
omacom:quattrofrom
sbalbalosa:fix/font-set-preserve-foot-size

Conversation

@sbalbalosa

Copy link
Copy Markdown
Contributor

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 via omarchy display text size or the display-panel slider.

Why

The Foot branch of bin/omarchy-font-set rewrote the whole font= line with a hardcoded :size=9:

sed -i "s/^font=.*/font=$font_name:size=9/g" ~/.config/foot/foot.ini

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=N from 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

  • Reproduced on 4.0.0-1 via both CLI and the GUI (slider → 16, then font picker → Foot back to 9).
  • With the fix, Foot keeps :size=12 across 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-existing omarchy-pkgs checkout-dependent tests (config-test, snapper-test, unowned-system-paths-test), which fail identically on unmodified origin/quattro in this environment.

Fixes #6957

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
Copilot AI balanced review requested due to automatic review settings August 15, 2026 11:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.ini when updating the font= 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.

Comment thread test/cli Resolved
Copilot AI review requested due to automatic review settings August 15, 2026 11:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@omarchybot omarchybot added the bug Something isn't working label Sep 27, 2026
dhh and others added 2 commits September 28, 2026 04:38
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]>
@omarchybot omarchybot added verified Omarchy Triage has verified that this issue is ready for final review ready Good to merge labels Sep 28, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

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, omarchy display text size 16 sets Foot to size=12, and omarchy font set "Adwaita Mono" then resets it to size=9. My own reproduction fails on quattro (3faafba), passes on this branch (also merged onto current quattro), and fails again with the fix reverted. The script keeps decimal sizes such as 10.5, falls back to 9 when there is no size, and leaves every other line of foot.ini untouched.

Two fixes pushed to your branch:

  • eff9a17: Foot's font= takes a comma-separated fallback list, and the greedy match took the last :size= on the line. So font=JetBrainsMono Nerd Font:size=12, Noto Color Emoji:size=10 became size=10. It now reads the primary font's size, which is the one omarchy display text size rewrites. The test fixture now includes a fallback font.
  • ff6cacf: the test picked a real font with fc-match under your HOME, then had omarchy-font-set check it with fc-list under the temporary HOME. A font installed only in the user's home would fail that check for reasons that have nothing to do with size. The test now stubs fc-list with a fixed family. It no longer skips-as-pass without fontconfig, and it fails against both the unfixed script and the greedy version.

Tests: ./test/cli passed (120/120) at ff6cacf on the worker. Merged onto current quattro, the new tests pass and kitty-config, theme-staging, theme-templates and desktop-entry-launch in test/shell.d/ pass. The only ./test/cli failure is vscode generated theme references current theme file, which fails on quattro alone too.

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 omarchy font set forcing Foot to 9, as part of moving terminal sizes into per-machine overlay files. This PR is the narrower fix for this bug alone. #12457, #10811 and #8179 edit the same Foot sed line for font-name escaping and XDG paths. Whichever lands second will need to keep both changes.

Waiting on the maintainer.

@omarchybot omarchybot added ready Good to merge and removed ready Good to merge labels Sep 28, 2026
@omarchybot
omarchybot merged commit 09ed48f into omacom:quattro Oct 31, 2026
omarchybot added a commit to chessing234/omarchy that referenced this pull request Oct 31, 2026
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]>
omarchybot added a commit to chessing234/omarchy that referenced this pull request Oct 31, 2026
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]>
omarchybot added a commit to calebdw/omarchy that referenced this pull request Oct 31, 2026
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.
@emirb emirb added this to the 4.5 milestone Nov 5, 2026
berenddeboer pushed a commit to berenddeboer/omarchy that referenced this pull request Nov 6, 2026
* 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working ready Good to merge verified Omarchy Triage has verified that this issue is ready for final review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

omarchy font set resets Foot font size to 9, ignoring omarchy display text size

5 participants