diff --git a/docs/changelog.rst b/docs/changelog.rst index 144110768..6003a237b 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -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] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/kitty/rc/ls.py b/kitty/rc/ls.py index 94beb5131..e2bb6e36c 100644 --- a/kitty/rc/ls.py +++ b/kitty/rc/ls.py @@ -49,7 +49,11 @@ Only list the window this command is run in. 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