kitty/kittens
Forrest 83677a2235 fix(choose-fonts): guard preview rendering against partial terminal color query
The choose-fonts kitten queries the terminal for the user's foreground and
background colors at startup by sending a DCS request. The terminal responds
with separate DCS response strings — one per field — which arrive
asynchronously through on_query_response.

The background handler unconditionally called draw_screen() after storing its
value. If the terminal's DCS response for "background" arrived before the
response for "foreground", draw_screen() fired with text_style.Foreground
still at its Go zero value ("").

The font list preview (list.go) only guarded against empty Background, not
empty Foreground, so it passed the check and sent a render_family_samples
command to the Python backend with foreground="". The backend's to_color('')
raised ValueError: Invalid color name: '', crashing the kitten.

The faces pane (faces.go) launched a render_family_samples goroutine
unconditionally when its preview cache was empty, with no guard at all.

Fix
---
1. ui.go — Only trigger draw_screen() from the foreground or background
   handler when the counterpart field is already populated, so the UI
   never renders with a partial TextStyle.

2. list.go — Require both Foreground and Background to be non-empty
   before rendering the font preview, not just Background alone.

3. faces.go — Skip the render_family_samples goroutine if either color
   field is still empty. The preview cache stays empty, so the next
   redraw (triggered when the counterpart query response arrives, or
   by on_wakeup) retries with full colors.
2026-06-10 02:18:18 -07:00
..
ask Modernize Go code 2026-03-21 08:41:47 +05:30
broadcast rename typing module to avoid conflicts with stdlib typing 2025-04-28 09:20:10 +05:30
choose_files choose-files kitten: Output a trailing newline when writing to a tty in text format 2026-05-07 08:53:09 +05:30
choose_fonts fix(choose-fonts): guard preview rendering against partial terminal color query 2026-06-10 02:18:18 -07:00
clipboard Use SIMD base64 everywhere 2026-04-21 11:56:55 +05:30
command_palette run go modernizer 2026-04-16 19:12:31 +05:30
desktop_ui desktop-ui kitten: Re-read config on every file chooser invocation via portal 2026-02-03 21:08:55 +05:30
diff diff kitten: Strip suid/sgid bits from extracted files 2026-06-03 05:45:04 +05:30
dnd dnd kitten: Create regular files with O_EXCL to avoid symlink attacks 2026-06-03 12:17:38 +05:30
hints Fix hints kitten breaking multi-byte UTF-8 characters when overlaying hint labels 2026-05-13 17:09:42 +08:00
hyperlinked_grep run modernize 2025-11-11 17:09:37 +05:30
icat DRYer 2026-04-10 15:32:27 +05:30
notify Use SIMD base64 everywhere 2026-04-21 11:56:55 +05:30
pager Rename go module from kitty -> github.com/kovidgoyal/kitty 2025-05-16 08:43:39 +05:30
panel Sort imports 2026-04-19 21:53:09 +05:30
query_terminal DRYer 2026-04-10 15:32:27 +05:30
quick_access_terminal Cache parsing of command line specifications 2025-09-29 12:31:10 +05:30
remote_file rename typing module to avoid conflicts with stdlib typing 2025-04-28 09:20:10 +05:30
resize_window
show_key Modernize Go code 2026-03-21 08:41:47 +05:30
ssh ssh kitten: avoid in-place mutation of cmd by slices.Insert 2026-05-18 23:08:33 -04:00
themes Add a note about interaction of --reload-in and auto reload 2026-06-07 08:55:48 +05:30
transfer Use SIMD base64 everywhere 2026-04-21 11:56:55 +05:30
tui Fix creating default event loop on Python 3.14+ 2025-10-13 20:09:54 +08:00
unicode_input Rename go module from kitty -> github.com/kovidgoyal/kitty 2025-05-16 08:43:39 +05:30
__init__.py
runner.py Allow custom kitten names with hyphens in them 2025-05-06 22:16:28 +05:30