@@ -152,13 +152,13 @@ def inline(sconf):
152
152
153
153
if len (sconf .keys ()) == int (1 ):
154
154
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 ]
162
162
163
163
# recurse into window and pane config items
164
164
if "windows" in sconf :
@@ -271,12 +271,19 @@ def expand(sconf, cwd=None, parent=None):
271
271
sconf ["shell_command_before" ], list
272
272
):
273
273
for i , scmd in enumerate (sconf ["shell_command_before" ]):
274
- if isinstance (scmd , dict ):
275
- scmd ["shell_command" ] = expandshell (scmd .get ("shell_command" ))
276
274
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
+
278
286
sconf ["shell_command_before" ][i ] = scmd
279
- print (sconf )
280
287
281
288
# recurse into window and pane config items
282
289
if "windows" in sconf :
@@ -461,7 +468,7 @@ def import_tmuxinator(sconf):
461
468
if "shell_command_before" not in tmuxp_config :
462
469
tmuxp_config ["shell_command_before" ] = []
463
470
tmuxp_config ["shell_command_before" ].append (
464
- {"shell_command" : "rbenv shell %s" % sconf ["rbenv" ]}
471
+ {"shell_command" : [ "rbenv shell %s" % sconf ["rbenv" ] ]}
465
472
)
466
473
467
474
for w in sconf ["windows" ]:
0 commit comments