From ac7b6870a88dc93a424fb7d6b084725f2cc714c0 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 10 Feb 2024 12:20:55 +0530 Subject: [PATCH] close_other_os_windows: to close non active OS windows Fixes #7113 --- docs/changelog.rst | 2 ++ kitty/boss.py | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/docs/changelog.rst b/docs/changelog.rst index b537377dd..2cc345825 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -70,6 +70,8 @@ Detailed list of changes - Special case rendering of some more box drawing characters using shades from the block of symbols for legacy computing (:iss:`7110`) +- A new :ac:`close_other_os_windows` to close non active OS windows (:disc:`7113`) + 0.32.1 [2024-01-26] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/kitty/boss.py b/kitty/boss.py index 536d58272..bd8fb4888 100644 --- a/kitty/boss.py +++ b/kitty/boss.py @@ -959,6 +959,14 @@ def close_other_tabs_in_os_window(self) -> None: if tab is not active_tab: self.close_tab(tab) + @ac('win', 'Close all other OS Windows other than the OS Window containing the currently active window') + def close_other_os_windows(self) -> None: + active = self.active_tab_manager + if active is not None: + for x in self.os_window_map.values(): + if x is not active: + self.mark_os_window_for_close(x.os_window_id) + def confirm( self, msg: str, # can contain newlines and ANSI formatting callback: Callable[..., None], # called with True or False and *args