Skip to content

Keep kitty bold and italic fonts in sync on font set - #13235

Open
Raj-Jagadeesh-A-P wants to merge 2 commits into
omacom:quattrofrom
Raj-Jagadeesh-A-P:fix/issue-9167
Open

Raj-Jagadeesh-A-P wants to merge 2 commits into
omacom:quattrofrom
Raj-Jagadeesh-A-P:fix/issue-9167

Conversation

@Raj-Jagadeesh-A-P

Copy link
Copy Markdown
Contributor

Fixes #9167.

omarchy-font-set now rewrites bold_font, italic_font, and bold_italic_font in kitty.conf (leaving "auto" values alone), so bold/italic text follows the selected font instead of falling back to a default face.

Copilot AI lite review requested due to automatic review settings September 25, 2026 15:56

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.

Copilot wasn't able to review any files in this pull request. Check if the Files changed in this pull request are included in default exclusions.


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

With no active font_family line, as in the stock template, font set appended one and skipped the face loop, so an explicit bold_font or italic_font kept the old font. The loop now runs on both paths. The auto exemption also moves into the sed address: a file-wide grep for auto skipped the whole face when an earlier `bold_font auto` sat above a later explicit override, which is the one kitty uses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Codex Medium <noreply@openai.com>
@omarchybot omarchybot added the verified Omarchy Triage has verified that this issue is ready for final review label Oct 3, 2026
@greptile-apps

greptile-apps Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

[Medium risk] Updates the font configuration script to sync bold and italic variants.

The PR should not merge until the styled-face selection is corrected.

Findings

  1. P1 Styled faces use regular family ▶
  2. P2 Tests miss face selection ▶

Summary

The PR updates explicit Kitty bold and italic directives when setting a font, while preserving auto values, and adds shell assertions for those edits.

  • Assigning the regular family name to styled-face directives may prevent the intended styled faces from being selected.
  • The new tests verify the edited text but not the resulting font selection.

Reviews (1) · Last reviewed commit: "Sync kitty faces on both font set paths,..."

Comment thread bin/omarchy-font-set
printf '\nfont_family %s\n' "$font_name" >>~/.config/kitty/kitty.conf
fi
for face in bold italic bold_italic; do
sed --follow-symlinks -i -E "/^[[:space:]]*${face}_font[[:space:]]+auto([[:space:]]|$)/! s/^[[:space:]]*${face}_font[[:space:]]+.*/${face}_font $kitty_font_name/" ~/.config/kitty/kitty.conf

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.

P1 Styled faces use regular family When a user selects a font with bold or italic faces, this rewrite sets explicit bold_font and italic_font values to the same family name as font_family. That does not ask Kitty to select the family's bold or italic face; auto does. Bold or italic text can therefore lose its intended weight or slant, leaving the rendering problem this PR aims to fix. Keep these settings automatic or select the actual styled faces.

Comment on lines +152 to +154
grep -qx 'bold_font Test Font' "$kitty_config" || fail "font command updates bold face past an earlier auto"
grep -qx 'italic_font Test Font' "$kitty_config" || fail "font command updates italic face"
grep -qx 'bold_italic_font auto' "$kitty_config" || fail "font command leaves auto faces alone"

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.

P2 Tests miss face selection These assertions only check that replacement lines appear in the config. The native Kitty check uses a separate temporary config, so the tests can pass even if the selected font renders bold or italic text as regular text. A face-selection check would catch the behavior this change is intended to fix.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@omarchybot omarchybot added the ready Good to merge label Oct 3, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Thanks for this. The bug is real: on quattro, omarchy font set rewrites font_family but leaves explicit bold_font and italic_font lines on the old font. I reproduced it on a disposable Omarchy worker. The check fails on quattro, passes on this branch, and fails again with the fix reverted.

I pushed one commit to your branch (f55df19) for two cases the loop missed:

  • No active font_family line. The stock ~/.config/kitty/kitty.conf has font_family commented out, so font set takes the append branch, and the face loop only ran in the replace branch. An explicit bold_font stayed on the old font the first time you ran it. The loop now runs on both paths.
  • auto above an explicit override. A file-wide grep for bold_font auto skipped the whole face, even when a later explicit bold_font Old Font was the line kitty actually uses. The auto check is now part of each sed's address, so it applies line by line. Codex found this one.

Both cases are covered in test/shell.d/kitty-config-test.sh. On the worker, ./test/cli and kitty-config-test.sh, desktop-entry-launch-test.sh and bin-style-test.sh pass at f55df19.

Greptile's P1 says that setting bold_font to the family name makes kitty use the regular face. That doesn't hold. On the worker, kitty 0.48.2 resolves bold_font JetBrainsMono Nerd Font to JetBrainsMonoNerdFont-Bold.ttf and italic_font to -Italic.ttf, the same files auto picks. So I didn't add the face-selection test Greptile's P2 suggests.

Reviewed by Claude Opus 5.5 and, as a second opinion, Codex Medium. Codex's first round found the auto case above, and its second round, on f55df19, found nothing; its independence from my review isn't guaranteed. This now waits on the maintainer.

@jandrusk

jandrusk commented Oct 8, 2026

Copy link
Copy Markdown

Heads-up: #9168 fixes the same issue (#9167) a different way. It resets explicit bold_font/italic_font/bold_italic_font lines to auto, while this PR rewrites them to the new family. Both edit the same block of bin/omarchy-font-set. The approach here keeps a user's deliberate explicit faces on the chosen font, which seems nicer, but maintainers will need to pick one so the other can be closed.

@omarchybot omarchybot removed ready Good to merge verified Omarchy Triage has verified that this issue is ready for final review labels Oct 28, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Thanks for this, @Raj-Jagadeesh-A-P. I looked at it again because it no longer merges cleanly with quattro: bin/omarchy-font-set has changed there since, in #6958 and #15820. quattro still has the bug from #9167, though. It rewrites font_family and leaves explicit bold_font, italic_font and bold_italic_font lines on the old font.

#9168 is an older open fix for the same issue. It resets any explicit face line to auto on both the rewrite and the append path, so kitty picks the bold and italic faces from the new family. With the commit pushed here earlier, this PR now covers both paths too. Neither PR handles a case the other misses, and #9168 still merges cleanly. When two fixes are this close, the older one is preferred, so I recommend #9168 and haven't merged quattro into this branch or tested it again. Your tests do cover something #9168's don't: the stock config, where font_family is commented out, and an explicit face that follows an earlier auto. I've asked for those to be carried over to #9168, expecting auto, with credit to you.

I compared the two diffs (Claude Opus 5.5). Codex Medium and muse-wonder (pi, thinking high) were each asked the same question without being told my answer, and both picked #9168. Codex is the one that suggested carrying over the tests. Their independence from my review isn't guaranteed. Choosing between the two is the maintainer's decision, so this PR is waiting on them.

omarchybot added a commit to harshithnadig/omarchy that referenced this pull request Nov 1, 2026
Move the font set face check into the existing Kitty test, as AGENTS.md asks of a new test, and cover the shipped config, where font_family is commented out and the first font set appends it, plus an explicit face that follows an earlier auto line. Both cases come from omacom#13235, with the expectation changed to the auto reset this pull request makes.

Co-Authored-By: Raj-Jagadeesh-A-P <rajjagadeesh2006@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

omarchy font set leaves bold_font/italic_font stale in kitty.conf — bold text renders the old font

4 participants