From 4dcccc553c8b9c06b52ff26e920745f164dff079 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 5 May 2021 14:02:58 +0530 Subject: [PATCH] ... --- kitty/tabs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kitty/tabs.py b/kitty/tabs.py index 030a76428..97501d523 100644 --- a/kitty/tabs.py +++ b/kitty/tabs.py @@ -756,7 +756,7 @@ class TabManager: # {{{ active_tab_before_removal = self.active_tab self._remove_tab(tab) active_tab = self.active_tab - active_tab_needs_to_change = (active_tab is None and active_tab_before_removal is None) or active_tab is tab + active_tab_needs_to_change = (active_tab is None and (active_tab_before_removal is None or active_tab_before_removal is tab)) or active_tab is tab while True: try: self.active_tab_history.remove(tab.id)