From 9e512ff58a421c6e81ab38aca91d47d6e2397a7c Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 4 Aug 2017 07:52:25 +0530 Subject: [PATCH] Ensure queue_action is only called after the Tab object is fully initialized Fix #103 --- kitty/tabs.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/kitty/tabs.py b/kitty/tabs.py index eaf4bed33..cbf8bf2c8 100644 --- a/kitty/tabs.py +++ b/kitty/tabs.py @@ -32,9 +32,12 @@ class Tab: self.borders = Borders(opts) self.windows = deque() self.active_window_idx = 0 + for i, which in enumerate('first second third fourth fifth sixth seventh eighth ninth tenth'.split()): + setattr(self, which + '_window', partial(self.nth_window, num=i)) if session_tab is None: self.cwd = args.directory l = self.enabled_layouts[0] + self.current_layout = all_layouts[l](opts, self.borders.border_width, self.windows) if special_window is None: queue_action(self.new_window) else: @@ -42,10 +45,8 @@ class Tab: else: self.cwd = session_tab.cwd or args.directory l = session_tab.layout + self.current_layout = all_layouts[l](opts, self.borders.border_width, self.windows) queue_action(self.startup, session_tab) - self.current_layout = all_layouts[l](opts, self.borders.border_width, self.windows) - for i, which in enumerate('first second third fourth fifth sixth seventh eighth ninth tenth'.split()): - setattr(self, which + '_window', partial(self.nth_window, num=i)) def startup(self, session_tab): for cmd in session_tab.windows: