Files
wezterm-config/wezterm.lua
gm d7eb6d3459 Fix font list parser producing garbage entries that corrupted config.font
wezterm ls-fonts --list-system's real output is a ready-to-paste code
snippet per font (`wezterm.font("Name", {weight=...}) -- (AKA: ...)
path, DirectWrite`), not a bare quoted family name. The picker's
fallback branch treated any non-matching line as a literal font name,
so selecting one of these snippet entries wrote its full text --
including a literal "})" substring from the embedded example call --
into config.font, corrupting the file (confirmed against a user's
actual .wezterm.lua that failed to parse after picking a Korean font
this way).

Fixed the parser to only accept `wezterm.font("Name"` lines (or a
bare quoted string) and extract just the family name, dropping
anything else instead of guessing. Also anchored get_current_fonts and
set_fonts's block-matching patterns to require the closing "})" be on
its own line, so a stray "})" embedded inside a font value can no
longer be mistaken for the block's real end.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-18 01:43:38 +09:00

33 KiB