From b569c01b49c564fd680749a7f8780b3cd283108d Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 18 Apr 2022 17:04:05 +0530 Subject: [PATCH] Fix #4986 --- kitty/tabs.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kitty/tabs.py b/kitty/tabs.py index 93f659d5c..1d0c2a15b 100644 --- a/kitty/tabs.py +++ b/kitty/tabs.py @@ -1018,9 +1018,8 @@ class TabManager: # {{{ def remove(self, tab: Tab) -> None: active_tab_before_removal = self.active_tab + active_tab_needs_to_change = active_tab_before_removal is 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_before_removal is tab)) or active_tab is tab while True: try: self.active_tab_history.remove(tab.id)