I want to pass a hash value of ${cwd}
to invoke tmux new -A -s
in an integrated terminal profile.
I tried various forms of "$(…)"
, like so:
"terminal.integrated.profiles.osx": {
"tmux": {
"path": "/usr/local/bin/tmux",
"args": [
"new",
"-A",
"-s",
"$(md5sum <<<${cwd} | cut -d ' ' -f 1)"
]
},
},
When this profile is invoked, a tmux
session does start, but its name is the literal $(md5sum <<</Users/USER/PATH/TO/CWD | cut -d ' ' -f 1)
, which is hard to work with.
2
Answers
Using @starball's suggestion, I wrote a simple wrapper:
and its invocation via
settings.json
:Now I have:
I’d suggest to try writing a wrapper script for that command and use that wrapper script in the
path
property. You’ll probably need to give your wrapper script a shebang for the shell it needs. Also, in case you need it, here‘s the VS Code variable reference.