@@ -152,12 +152,13 @@ def inline(sconf):
152
152
153
153
if len (sconf .keys ()) == int (1 ):
154
154
sconf = sconf ["shell_command" ]
155
- if (
156
- "shell_command_before" in sconf
157
- and isinstance (sconf ["shell_command_before" ], list )
158
- and len (sconf ["shell_command_before" ]) == 1
159
- ):
160
- sconf ["shell_command_before" ] = sconf ["shell_command_before" ][0 ]
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]
161
162
162
163
# recurse into window and pane config items
163
164
if "windows" in sconf :
@@ -269,9 +270,13 @@ def expand(sconf, cwd=None, parent=None):
269
270
if "shell_command_before" in sconf and isinstance (
270
271
sconf ["shell_command_before" ], list
271
272
):
272
- sconf ["shell_command_before" ] = [
273
- expandshell (scmd ) for scmd in sconf ["shell_command_before" ]
274
- ]
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
+ if isinstance (scmd , str ):
277
+ scmd = {"shell_command" : expandshell (scmd )}
278
+ sconf ["shell_command_before" ][i ] = scmd
279
+ print (sconf )
275
280
276
281
# recurse into window and pane config items
277
282
if "windows" in sconf :
@@ -455,7 +460,9 @@ def import_tmuxinator(sconf):
455
460
if "rbenv" in sconf :
456
461
if "shell_command_before" not in tmuxp_config :
457
462
tmuxp_config ["shell_command_before" ] = []
458
- tmuxp_config ["shell_command_before" ].append ("rbenv shell %s" % sconf ["rbenv" ])
463
+ tmuxp_config ["shell_command_before" ].append (
464
+ {"shell_command" : "rbenv shell %s" % sconf ["rbenv" ]}
465
+ )
459
466
460
467
for w in sconf ["windows" ]:
461
468
for k , v in w .items ():
0 commit comments