close_other_os_windows: to close non active OS windows

Fixes #7113
This commit is contained in:
Kovid Goyal
2024-02-10 12:20:55 +05:30
parent 576a269648
commit ac7b6870a8
2 changed files with 10 additions and 0 deletions

View File

@@ -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`) - 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] 0.32.1 [2024-01-26]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@@ -959,6 +959,14 @@ class Boss:
if tab is not active_tab: if tab is not active_tab:
self.close_tab(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( def confirm(
self, msg: str, # can contain newlines and ANSI formatting self, msg: str, # can contain newlines and ANSI formatting
callback: Callable[..., None], # called with True or False and *args callback: Callable[..., None], # called with True or False and *args