From 36163fd53292c377344e0232471071f29e472119 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 22 Aug 2025 21:34:26 +0530 Subject: [PATCH] Ensure current layout is in enabled layouts when serializing --- kitty/tabs.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/kitty/tabs.py b/kitty/tabs.py index c581bf5be..c0d8b07e3 100644 --- a/kitty/tabs.py +++ b/kitty/tabs.py @@ -321,11 +321,15 @@ class Tab: # {{{ if i == active_idx: launch_cmds.append('focus') if launch_cmds: + enabled_layouts = list(self.enabled_layouts) + layout = self._current_layout_name + if layout not in enabled_layouts: + enabled_layouts.append(layout) return [ '', f'new_tab {self.name}'.rstrip(), - f'layout {self._current_layout_name}', - f'enabled_layouts {",".join(self.enabled_layouts)}', + f'layout {layout}', + f'enabled_layouts {",".join(enabled_layouts)}', f'set_layout_state {json.dumps(self.current_layout.serialize(self.windows))}', f'cd {most_common_cwd}', ''