This commit is contained in:
Kovid Goyal 2026-10-16 13:03:15 +05:30
parent 7e2a3cf81f
commit 0ea80af638
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C
3 changed files with 8 additions and 5 deletions

View file

@ -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
<indexed_color_data>` whose pixels are indices into the terminal color
palette, so that images automatically change color along with the terminal

View file

@ -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')

View file

@ -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']: