From 0ea80af63875a0a93a2bec4e673fde41e0438323 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 16 Oct 2026 13:03:15 +0530 Subject: [PATCH] Fix #10672 --- docs/changelog.rst | 3 +++ kitty/rc/action.py | 2 +- kitty/rc/base.py | 8 ++++---- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index a34149228..541b9628a 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -250,6 +250,9 @@ Detailed list of changes - Fix kitty repeatedly calling ``on_quit`` watchers when a watcher aborts a quit requested by the OS, for example, via the macOS menu or Dock +- Remote control: Fix ``kitten @ action --match`` ignoring the match and + running the action on the active window (:iss:`10672`) + - Graphics protocol: Add two new :ref:`indexed color image formats ` whose pixels are indices into the terminal color palette, so that images automatically change color along with the terminal diff --git a/kitty/rc/action.py b/kitty/rc/action.py index fca0a24de..b567f4eb4 100644 --- a/kitty/rc/action.py +++ b/kitty/rc/action.py @@ -63,7 +63,7 @@ using this option means that you will not be notified of failures. return {'action': ' '.join(args), 'self': opts.self, 'match_window': opts.match} def response_from_kitty(self, boss: Boss, window: Window | None, payload_get: PayloadGetType) -> ResponseType: - w = self.windows_for_match_payload(boss, window, payload_get) + w = self.windows_for_match_payload(boss, window, payload_get, 'match_window') if w: window = w[0] ac = payload_get('action') diff --git a/kitty/rc/base.py b/kitty/rc/base.py index 719c4217c..1f11257e6 100644 --- a/kitty/rc/base.py +++ b/kitty/rc/base.py @@ -363,7 +363,7 @@ class RemoteCommand: return self.defaults.get(name, missing) return missing - def windows_for_match_payload(self, boss: 'Boss', window: Optional['Window'], payload_get: PayloadGetType) -> list['Window']: + def windows_for_match_payload(self, boss: 'Boss', window: Optional['Window'], payload_get: PayloadGetType, match_name: str = 'match') -> list['Window']: if payload_get('all'): windows = list(boss.all_windows) else: @@ -373,10 +373,10 @@ class RemoteCommand: else: window = boss.active_window or window windows = [window] if window else [] - if payload_get('match'): - windows = list(boss.match_windows(payload_get('match'), self_window)) + if match := payload_get(match_name): + windows = list(boss.match_windows(match, self_window)) if not windows: - raise MatchError(payload_get('match')) + raise MatchError(match) return windows def tabs_for_match_payload(self, boss: 'Boss', window: Optional['Window'], payload_get: PayloadGetType) -> list['Tab']: