Skip to content

Commit 584c237

Browse files
committed
!wip
1 parent f554632 commit 584c237

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

tmuxp/config.py

+17-10
Original file line numberDiff line numberDiff line change
@@ -152,12 +152,13 @@ def inline(sconf):
152152

153153
if len(sconf.keys()) == int(1):
154154
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]
161162

162163
# recurse into window and pane config items
163164
if "windows" in sconf:
@@ -269,9 +270,13 @@ def expand(sconf, cwd=None, parent=None):
269270
if "shell_command_before" in sconf and isinstance(
270271
sconf["shell_command_before"], list
271272
):
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)
275280

276281
# recurse into window and pane config items
277282
if "windows" in sconf:
@@ -455,7 +460,9 @@ def import_tmuxinator(sconf):
455460
if "rbenv" in sconf:
456461
if "shell_command_before" not in tmuxp_config:
457462
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+
)
459466

460467
for w in sconf["windows"]:
461468
for k, v in w.items():

0 commit comments

Comments
 (0)