i’m trying to write a python script which can execute two commands
sudo docker run --network=host --volume /home/villas/results:/villas/build/results --volume /home/villas/Docker-containers/webrtc-rtt.conf:/config.conf --privileged registry.git.rwth-aachen.de/acs/public/villas/node:master node /config.conf
and
sudo docker run --network=host --volume /home/villas/results:/villas/build/results --volume /home/villas/Docker-containers/webrtc-loopback.conf:/config.conf --privileged registry.git.rwth-aachen.de/acs/public/villas/node:master node /config.conf
in two different terminals at the same time.
So what the script needs to do is, execute the first command in one terminal, and then create a new parallel terminal and the second command will be execute in second terminal.
To create a split terminal manually, I have to press ctrl+shift+5
But instead I want let my python script to do this job.
Is there any way to code this into the python script?
2
Answers
If you want to do this at the VS Code level, I’m pretty sure you can’t (invoke general VS Code commands from terminal) right now. See Possible to invoke a VSCode extension command from command line?.
If you want to do this within a terminal in VS Code, look into terminal multiplexer software like tmux.
Alternatives:
runCommands
and Shortcut for running terminal command in VS code would help with that, as well as the respective commands for creating and focusing terminals.Try this
tasks.json
: