diff --git a/kitty/tabs.py b/kitty/tabs.py index d92730790..6117d378c 100644 --- a/kitty/tabs.py +++ b/kitty/tabs.py @@ -99,8 +99,9 @@ class Tab: # {{{ def relayout_borders(self): tm = self.tab_manager_ref() if tm is not None: - self.borders(self.windows, self.active_window, self.current_layout, - tm.blank_rects, self.current_layout.needs_window_borders and len(self.windows) > 1) + visible_windows = [w for w in self.windows if w.is_visible_in_layout] + self.borders(visible_windows, self.active_window, self.current_layout, + tm.blank_rects, self.current_layout.needs_window_borders and len(visible_windows) > 1) def create_layout_object(self, idx): return all_layouts[idx](self.os_window_id, self.id, self.opts, self.borders.border_width)