kitten @ ls: Fix the `--self` flag not working

Fixes #7864
This commit is contained in:
Kovid Goyal 2024-09-17 10:39:15 +05:30
parent f3112d61ef
commit 25e255e66f
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C
2 changed files with 7 additions and 1 deletions

View file

@ -89,6 +89,8 @@ Detailed list of changes
- macOS: Fix a regression in the previous release that caused kitty to fail to run after an unclean shutdown/crash when using --single-instance (:iss:`7846`)
- kitten @ ls: Fix the ``--self`` flag not working (:iss:`7864`)
0.36.2 [2024-09-06]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View file

@ -49,7 +49,11 @@ def response_from_kitty(self, boss: Boss, window: Optional[Window], payload_get:
tab_filter: Optional[Callable[[Tab], 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('self'):
def wf(w: Window) -> bool:
return w is window
window_filter = wf
elif 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_match_name='match'))
def wf(w: Window) -> bool:
return w.id in window_ids