From 4a83584934c1ac2713b0713b76eb3661c2e1b767 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 5 May 2021 13:55:46 +0530 Subject: [PATCH] Fix #3576 --- kitty/tabs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kitty/tabs.py b/kitty/tabs.py index 137bfb90f..94f92dfce 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) try: - active_tab_needs_to_change = self.active_tab is None or self.active_tab is tab + active_tab_needs_to_change = (self.active_tab is None and active_tab_before_removal is None) or self.active_tab is tab except IndexError: active_tab_needs_to_change = True while True: