d7eb6d3459082943d5625cc3091ed817b0e5ace2
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>
Description
WezTerm configuration
Languages
Lua
100%