What I am trying to do :
I am trying to spawn a background process and redirect its output to VSC's shell. This background process should be independent from the parent shell, because VSC will wait until the shell that spawned it (the parent shell) sends an exit code.
#!/bin/bash echo "Starting webpack-dev-server" cd .. && cd client && yarn debug
What I am doing :
Following this guide I should be able to spawn a background process by appending a
& after a script. It doesn't seem to make the script independent from the parent.
The parent shell seems to take over the output of the background process and never sends the exit signal. Killing the parent shell then also kills the background process.
Sending the output to
./startWebpack.sh > /dev/null did not make any difference. I could actually still see the output of that command.
VSC runs the command internally with
bash -c ./startWebpack.sh & source. Not sure if that is affecting anything.