Repository navigation
Keep kitty bold and italic fonts in sync on font set - #13235
Raj-Jagadeesh-A-P wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
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>
|
| 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 |
There was a problem hiding this comment.
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.
| 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" |
There was a problem hiding this comment.
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!
|
Thanks for this. The bug is real: on I pushed one commit to your branch (f55df19) for two cases the loop missed:
Both cases are covered in Greptile's P1 says that setting Reviewed by Claude Opus 5.5 and, as a second opinion, Codex Medium. Codex's first round found the |
|
Heads-up: #9168 fixes the same issue (#9167) a different way. It resets explicit |
|
Thanks for this, @Raj-Jagadeesh-A-P. I looked at it again because it no longer merges cleanly with #9168 is an older open fix for the same issue. It resets any explicit face line to 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. |
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>
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.