Merge branch 'fix/launch-color-accumulation' of https://github.com/M-Hassan-Raza/kitty
Some checks are pending
CI / Linux (python=3.14 cc=clang sanitize=1) (push) Waiting to run
CI / Linux (python=3.12 cc=gcc sanitize=0) (push) Waiting to run
CI / Linux (python=3.13 cc=gcc sanitize=1) (push) Waiting to run
CI / Linux package (push) Waiting to run
CI / Bundle test (macos-latest) (push) Waiting to run
CI / Bundle test (ubuntu-latest) (push) Waiting to run
CI / macOS Brew (push) Waiting to run
CI / Test ./dev.sh and benchmark (push) Waiting to run
CodeQL / CodeQL-Build (actions, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (c, macos-latest) (push) Waiting to run
CodeQL / CodeQL-Build (c, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (go, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (python, ubuntu-latest) (push) Waiting to run
Depscan / Scan dependencies for vulnerabilities (push) Waiting to run

This commit is contained in:
Kovid Goyal 2026-09-27 11:38:27 +05:30
commit 4136c93c38
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C
3 changed files with 23 additions and 2 deletions

View file

@ -202,6 +202,8 @@ Detailed list of changes
0.49.2 [future]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Preserve transparent background colors when applying unrelated launch color overrides
- ssh kitten: Preserve SSH option values following a spaced :code:`--kitten` option
- A new option :opt:`detect_url_regex` to detect arbitrary text, such as file

View file

@ -215,7 +215,7 @@ def parse_colors(
colors: dict[str, Color | None | int] = {}
nullable_color_map: dict[str, int | None] = {}
special_color_map: dict[str, int] = {}
transparent_background_colors = ()
transparent_background_colors: TransparentBackgroundColors = ()
allowed = all_color_related_conf_keys()
for spec in args:
conf: dict[str, Any] = {}
@ -230,7 +230,7 @@ def parse_colors(
conf = parse_config(f)
elif allow_reading_conf_files:
conf = parse_config(spec)
transparent_background_colors = conf.pop('transparent_background_colors', ())
transparent_background_colors = conf.pop('transparent_background_colors', transparent_background_colors)
if background_image_options is not None:
bio: dict[str, Any] = cast(dict[str, Any], background_image_options)
for key in BackgroundImageOptions.__optional_keys__:

View file

@ -90,6 +90,25 @@ class TestConfParsing(BaseTest):
{'work': seen_path, 'other': os.path.join(config_dir, 'other.kitty-session')},
)
def test_launch_transparent_color_overrides(self) -> None:
from kitty.launch import apply_colors
from kitty.window import Window
cases = (
(('transparent_background_colors=#ffffff@0.5', 'foreground=red'), ((Color(255, 255, 255), 0.5),)),
(('foreground=red', 'transparent_background_colors=#ffffff@0.5'), ((Color(255, 255, 255), 0.5),)),
(('transparent_background_colors=#ffffff@0.5', 'foreground=red', 'transparent_background_colors='), ()),
(('transparent_background_colors=#ffffff@0.5', 'transparent_background_colors=#000000@0.25', 'foreground=red'), ((Color(0, 0, 0), 0.25),)),
)
for colors, expected in cases:
with self.subTest(colors=colors):
window = Window.__new__(Window)
window.screen = self.create_screen()
apply_colors(window, colors)
actual = window.screen.color_profile.as_dict()
self.ae(actual.get('transparent_background_colors', ()), expected)
self.ae(actual['foreground'], 0xFF0000)
def cli_parsing(self):
from kitty.cli import CLIOptions, Options, parse_cmdline, parse_option_spec