I would like to create a keyboard shortcut that opens a terminal tab and then runs a command that includes the filename. I have tried using multi-command
with Terminal Here
in the following way:
"multiCommand.commands":[
{
"command": "multiCommand.formatLaTeX",
"interval": 750,
"sequence":[
"workbench.action.files.save",
"terminalHere.create",
{
"command": "workbench.action.terminal.sendSequence",
"args": {"text": "pdftex -ini -jobname=\"${fileBasenameNoExtension}\" \"&pdflatex\" mylatexformat.ltx ${fileBasename}\u000D"},
}
]
}
]
This saves the file, opens a terminal in a new window in the same directory, and then tries to run the command.
When I use "normal" characters that don't include filenames, i.e. no ${fileBasename}
, it works perfectly.
How can I make it work when I use the file names? For example, if I'm working in foo.tex
, I want it to run the command
pdftex -ini -jobname="foo" "&pdflatex" mylatexformat.ltx foo.tex
and then execute it.