@@ -152,13 +152,13 @@ def inline(sconf):
152152
153153 if len (sconf .keys ()) == int (1 ):
154154 sconf = sconf ["shell_command" ]
155- # todo rewrite inlines
156- # if (
157- # "shell_command_before" in sconf
158- # and isinstance(sconf["shell_command_before"], list)
159- # and len(sconf["shell_command_before"]) == 1
160- # ):
161- # sconf["shell_command_before"] = sconf["shell_command_before"][0]
155+
156+ if (
157+ "shell_command_before" in sconf
158+ and isinstance (sconf ["shell_command_before" ], list )
159+ and len (sconf ["shell_command_before" ]) == 1
160+ ):
161+ sconf ["shell_command_before" ] = sconf ["shell_command_before" ][0 ]
162162
163163 # recurse into window and pane config items
164164 if "windows" in sconf :
@@ -271,12 +271,19 @@ def expand(sconf, cwd=None, parent=None):
271271 sconf ["shell_command_before" ], list
272272 ):
273273 for i , scmd in enumerate (sconf ["shell_command_before" ]):
274- if isinstance (scmd , dict ):
275- scmd ["shell_command" ] = expandshell (scmd .get ("shell_command" ))
276274 if isinstance (scmd , str ):
277- scmd = {"shell_command" : expandshell (scmd )}
275+ scmd = [expandshell (scmd )]
276+ if isinstance (scmd , list ):
277+ for _i , subcmd in enumerate (scmd ):
278+ if isinstance (subcmd , str ):
279+ subcmd = {"shell_command" : subcmd }
280+
281+ shell_command = subcmd .get ("shell_command" )
282+ if isinstance (shell_command , list ):
283+ shell_command [:] = [expandshell (_s ) for _s in shell_command ]
284+ scmd [_i ] = subcmd
285+
278286 sconf ["shell_command_before" ][i ] = scmd
279- print (sconf )
280287
281288 # recurse into window and pane config items
282289 if "windows" in sconf :
@@ -461,7 +468,7 @@ def import_tmuxinator(sconf):
461468 if "shell_command_before" not in tmuxp_config :
462469 tmuxp_config ["shell_command_before" ] = []
463470 tmuxp_config ["shell_command_before" ].append (
464- {"shell_command" : "rbenv shell %s" % sconf ["rbenv" ]}
471+ {"shell_command" : [ "rbenv shell %s" % sconf ["rbenv" ] ]}
465472 )
466473
467474 for w in sconf ["windows" ]:
0 commit comments