From 6c81547e24c5e7333eff1cc0bb0c13c8a980c04b Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 8 Nov 2025 00:55:10 +0530 Subject: [PATCH] Output the set of special colors separately --- gen/config.py | 10 ++++++++-- kitty/options/types.py | 7 +++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/gen/config.py b/gen/config.py index cb07f2f58..d41e9c84d 100755 --- a/gen/config.py +++ b/gen/config.py @@ -43,6 +43,7 @@ def main(args: list[str]=sys.argv) -> None: from kitty.options.definition import definition nullable_colors = [] all_colors = [] + special_colors = [] for opt in definition.iter_all_options(): if callable(opt.parser_func): match opt.parser_func.__name__: @@ -50,14 +51,19 @@ def main(args: list[str]=sys.argv) -> None: all_colors.append(opt.name) case 'macos_titlebar_color' | 'titlebar_color' | 'scrollbar_color': all_colors.append(opt.name) + special_colors.append(opt.name) case 'to_color_or_none' | 'cursor_text_color': - nullable_colors.append(opt.name) all_colors.append(opt.name) + nullable_colors.append(opt.name) patch_color_list('tools/cmd/at/set_colors.go', nullable_colors, 'NULLABLE') patch_color_list('tools/themes/collection.go', all_colors, 'ALL') nc = ',\n '.join(f'{x!r}' for x in nullable_colors) - write_output('kitty', definition, f'\nnullable_colors = frozenset({{\n {nc}\n}})\n') + sc = ',\n '.join(f'{x!r}' for x in special_colors) + write_output('kitty', definition, + f'\nnullable_colors = frozenset({{\n {nc}\n}})\n' + f'\nspecial_colors = frozenset({{\n {sc}\n}})\n' + ) if __name__ == '__main__': diff --git a/kitty/options/types.py b/kitty/options/types.py index 61ca32c37..cd9d8b8b6 100644 --- a/kitty/options/types.py +++ b/kitty/options/types.py @@ -1095,5 +1095,12 @@ nullable_colors = frozenset({ 'selection_background' }) +special_colors = frozenset({ + 'scrollbar_handle_color', + 'scrollbar_track_color', + 'wayland_titlebar_color', + 'macos_titlebar_color' +}) + secret_options = ('remote_control_password', 'file_transfer_confirmation_bypass') \ No newline at end of file