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
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C
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`)
- A new :ac:`close_other_os_windows` to close non active OS windows (:disc:`7113`)
0.32.1 [2024-01-26]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View file

@ -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