From 2b5117f0147369041d8dbf9c286282ac167726fe Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 6 Dec 2025 10:06:05 +0530 Subject: [PATCH] Fix #9271 --- kitty/boss.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/kitty/boss.py b/kitty/boss.py index fb7a794b1..fa9db79ed 100644 --- a/kitty/boss.py +++ b/kitty/boss.py @@ -1956,6 +1956,18 @@ def confirm_os_window_close(self, os_window_id: int) -> None: if not needs_confirmation: self.mark_os_window_for_close(os_window_id) return + current_confirmation_window: Window | None = None + if tm.confirm_close_window_id: + for tab in tm: + for w in tab: + if w.id == tm.confirm_close_window_id: + current_confirmation_window = w + break + if current_confirmation_window is not None: + break + if current_confirmation_window: + self.switch_focus_to(current_confirmation_window.id) + return msg = msg or _('It has {} windows?').format(num) msg = _('Are you sure you want to close this OS Window?') + ' ' + msg w = self.confirm(msg, self.handle_close_os_window_confirmation, os_window_id, window=tm.active_window, title=_('Close OS window'))