@@ -23,7 +23,7 @@ def import_tmuxinator(workspace_dict: dict[str, t.Any]) -> WorkspaceConfig:
2323 dict
2424 A dictionary conforming to WorkspaceConfig structure.
2525 """
26- tmuxp_workspace : WorkspaceConfig = {"windows " : []} # type: ignore[typeddict-item]
26+ tmuxp_workspace : WorkspaceConfig = {"session_name " : None , "windows" : []}
2727
2828 if "project_name" in workspace_dict :
2929 tmuxp_workspace ["session_name" ] = workspace_dict .pop ("project_name" )
@@ -75,6 +75,15 @@ def import_tmuxinator(workspace_dict: dict[str, t.Any]) -> WorkspaceConfig:
7575 if "rbenv" in workspace_dict :
7676 if "shell_command_before" not in tmuxp_workspace :
7777 tmuxp_workspace ["shell_command_before" ] = []
78+ else :
79+ # Ensure shell_command_before is a list
80+ current = tmuxp_workspace ["shell_command_before" ]
81+ if isinstance (current , str ):
82+ tmuxp_workspace ["shell_command_before" ] = [current ]
83+ elif isinstance (current , dict ):
84+ tmuxp_workspace ["shell_command_before" ] = [current ]
85+ # Now we can safely append
86+ assert isinstance (tmuxp_workspace ["shell_command_before" ], list )
7887 tmuxp_workspace ["shell_command_before" ].append (
7988 "rbenv shell {}" .format (workspace_dict ["rbenv" ]),
8089 )
@@ -83,10 +92,14 @@ def import_tmuxinator(workspace_dict: dict[str, t.Any]) -> WorkspaceConfig:
8392 for k , v in window_item .items ():
8493 new_window : WindowConfig = {"window_name" : k }
8594
86- if isinstance (v , str ) or v is None :
95+ if isinstance (v , str ):
8796 new_window ["panes" ] = [v ]
8897 tmuxp_workspace ["windows" ].append (new_window )
8998 continue
99+ if v is None :
100+ new_window ["panes" ] = ["" ] # Empty pane
101+ tmuxp_workspace ["windows" ].append (new_window )
102+ continue
90103 if isinstance (v , list ):
91104 new_window ["panes" ] = v
92105 tmuxp_workspace ["windows" ].append (new_window )
@@ -130,7 +143,7 @@ def import_teamocil(workspace_dict: dict[str, t.Any]) -> WorkspaceConfig:
130143 - clear
131144 - cmd_separator
132145 """
133- tmuxp_workspace : WorkspaceConfig = {"windows " : []} # type: ignore[typeddict-item]
146+ tmuxp_workspace : WorkspaceConfig = {"session_name " : None , "windows" : []}
134147
135148 if "session" in workspace_dict :
136149 workspace_dict = workspace_dict ["session" ]
0 commit comments