Fix --match not working for some remote control commands

This commit is contained in:
Kovid Goyal
2024-03-05 08:00:57 +05:30
parent c3c99113c7
commit 7b34c0603f
4 changed files with 6 additions and 3 deletions

View File

@@ -83,6 +83,9 @@ Detailed list of changes
- hints kitten: Use default editor rather than hardcoding vim to open file at specific line (:iss:`7186`) - hints kitten: Use default editor rather than hardcoding vim to open file at specific line (:iss:`7186`)
- Remote control: Fix ``--match`` argument not working for @ls, @send-key,
@set-background-image (:iss:`7192`)
0.32.2 [2024-02-12] 0.32.2 [2024-02-12]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@@ -50,7 +50,7 @@ Only list the window this command is run in.
window_filter: Optional[Callable[[Window], bool]] = None window_filter: Optional[Callable[[Window], bool]] = None
if payload_get('match') is not None or payload_get('match_tab') is not None: if payload_get('match') is not None or payload_get('match_tab') is not None:
window_ids = frozenset(w.id for w in self.windows_for_payload(boss, window, payload_get)) window_ids = frozenset(w.id for w in self.windows_for_payload(boss, window, payload_get, window_match_name='match'))
def wf(w: Window) -> bool: def wf(w: Window) -> bool:
return w.id in window_ids return w.id in window_ids
window_filter = wf window_filter = wf

View File

@@ -52,7 +52,7 @@ Do not send text to the active window, even if it is one of the matched windows.
return ret return ret
def response_from_kitty(self, boss: Boss, window: Optional[Window], payload_get: PayloadGetType) -> ResponseType: def response_from_kitty(self, boss: Boss, window: Optional[Window], payload_get: PayloadGetType) -> ResponseType:
windows = self.windows_for_payload(boss, None, payload_get) windows = self.windows_for_payload(boss, None, payload_get, window_match_name='match')
keys = payload_get('keys') keys = payload_get('keys')
sent = False sent = False
for w in windows: for w in windows:

View File

@@ -108,7 +108,7 @@ failed, the command will exit with a success code.
def response_from_kitty(self, boss: Boss, window: Optional[Window], payload_get: PayloadGetType) -> ResponseType: def response_from_kitty(self, boss: Boss, window: Optional[Window], payload_get: PayloadGetType) -> ResponseType:
data = payload_get('data') data = payload_get('data')
windows = self.windows_for_payload(boss, window, payload_get) windows = self.windows_for_payload(boss, window, payload_get, window_match_name='match')
os_windows = tuple({w.os_window_id for w in windows if w}) os_windows = tuple({w.os_window_id for w in windows if w})
layout = payload_get('layout') layout = payload_get('layout')
if data == '-': if data == '-':