diff --git a/kitty/tabs.py b/kitty/tabs.py index aee6ead12..5c7d1d310 100644 --- a/kitty/tabs.py +++ b/kitty/tabs.py @@ -324,8 +324,7 @@ class Tab: # {{{ return underlaid_window, overlaid_window def attach_window(self, window): - window.tab_id = self.id - window.os_window_id = self.os_window_id + window.change_tab(self) attach_window(self.os_window_id, self.id, window.id) self._add_window(window) diff --git a/kitty/window.py b/kitty/window.py index c3b0b02a4..83f03c990 100644 --- a/kitty/window.py +++ b/kitty/window.py @@ -163,6 +163,11 @@ class Window: else: setup_colors(self.screen, opts) + def change_tab(self, tab): + self.tab_id = tab.id + self.os_window_id = tab.os_window_id + self.tabref = weakref.ref(tab) + @property def title(self): return self.override_title or self.child_title