Add a new mappable action close_other_tabs_in_os_window
This commit is contained in:
@@ -77,6 +77,8 @@ Detailed list of changes
|
|||||||
- Fix resizing window that is extra tall/wide because of left-over cells not
|
- Fix resizing window that is extra tall/wide because of left-over cells not
|
||||||
working reliably (:iss:`4913`)
|
working reliably (:iss:`4913`)
|
||||||
|
|
||||||
|
- A new action :ac:`close_other_tabs_in_os_window` to close other tabs in the active OS window (:pull:`4944`)
|
||||||
|
|
||||||
|
|
||||||
0.24.4 [2022-03-03]
|
0.24.4 [2022-03-03]
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|||||||
@@ -673,6 +673,15 @@ class Boss:
|
|||||||
if tab:
|
if tab:
|
||||||
self.confirm_tab_close(tab)
|
self.confirm_tab_close(tab)
|
||||||
|
|
||||||
|
@ac('tab', 'Close all the tabs in the current OS window other than the currently active tab')
|
||||||
|
def close_other_tabs_in_os_window(self) -> None:
|
||||||
|
tm = self.active_tab_manager
|
||||||
|
if tm is not None and len(tm.tabs) > 1:
|
||||||
|
active_tab = self.active_tab
|
||||||
|
for tab in tm:
|
||||||
|
if tab is not active_tab:
|
||||||
|
self.close_tab(tab)
|
||||||
|
|
||||||
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
|
||||||
|
|||||||
Reference in New Issue
Block a user