From 14d693a8fffec6d76e854904bd2925d73fe3fbca Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 9 Nov 2019 11:09:29 +0530 Subject: [PATCH] When attaching window make its parent tab active --- kitty/boss.py | 1 + kitty/tabs.py | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/kitty/boss.py b/kitty/boss.py index 57f770a08..0f796976f 100644 --- a/kitty/boss.py +++ b/kitty/boss.py @@ -1139,6 +1139,7 @@ class Boss: if overlaid_window: target_tab.attach_window(overlaid_window) self._cleanup_tab_after_window_removal(src_tab) + target_tab.make_active() def detach_window(self, *args): if not args: diff --git a/kitty/tabs.py b/kitty/tabs.py index d0a173538..aee6ead12 100644 --- a/kitty/tabs.py +++ b/kitty/tabs.py @@ -417,6 +417,11 @@ class Tab: # {{{ def __repr__(self): return 'Tab(title={}, id={})'.format(self.name or self.title, hex(id(self))) + + def make_active(self): + tm = self.tab_manager_ref() + if tm is not None: + tm.set_active_tab(self) # }}}