diff --git a/kitty/boss.py b/kitty/boss.py index 5292471cd..4084f2e41 100644 --- a/kitty/boss.py +++ b/kitty/boss.py @@ -450,8 +450,7 @@ class Boss: windows = tuple(tab) needs_confirmation = self.opts.confirm_os_window_close > 0 and len(windows) >= self.opts.confirm_os_window_close if not needs_confirmation: - for window in windows: - self.close_window(window) + self.close_tab_no_confirm(tab) return self._run_kitten('ask', ['--type=yesno', '--message', _( 'Are you sure you want to close this tab, it has {}' @@ -468,6 +467,9 @@ class Boss: break else: return + self.close_tab_no_confirm(tab) + + def close_tab_no_confirm(self, tab: Tab) -> None: for window in tab: self.close_window(window) diff --git a/kitty/rc/close_tab.py b/kitty/rc/close_tab.py index 963378e74..074363066 100644 --- a/kitty/rc/close_tab.py +++ b/kitty/rc/close_tab.py @@ -36,7 +36,7 @@ If specified close the tab this command is run in, rather than the active tab. for tab in self.tabs_for_match_payload(boss, window, payload_get): if window: if tab: - boss.close_tab(tab) + boss.close_tab_no_confirm(tab) close_tab = CloseTab()