In a compound launch configuration, Start Debugging (F5) starts all targets but Stop & Restart only affect the current target. This makes restarting all targets (e.g. after source code changes) very slow. Not sure the best way this could be improved but would like to Restart all targets with a single button/key. (NB I also made a comment here requesting post-launch task support for compound launch configurations: #2405).
There should be something like "stop all", "restart all" as we should not change the current behavior.
Leaving this open as a feature request.
Sure, not suggesting to remove current single target stop/re-start which is useful (although less often for me).
we need to resolve this.
Edit: I think this point will be addressed by separate issue https://github.com/Microsoft/vscode/issues/56756
I still would love the above feature but here is an additional point.
I now often use integrated terminals and a compound launch configuration for debugging multiple Node processes with Nodemon. Typical config in compound set is shown below. It would be so great if Stop could kill nodemon in this case to avoid pressing Ctrl+C in each terminal. Maybe this is a separate feature though.
PS: I realise I could possibly use attach rather than launch configs each with a separate port to manage this situation but then I would need a separate set of tasks or a script to managing launching.... not good for maintainability..... much better to have process launch/debug info together....
{
"type": "node",
"request": "launch",
"name": "Ws",
"runtimeExecutable": "nodemon",
"program": "${workspaceFolder}/ws.js",
"restart": true,
"env": {
"NODE_ENV": "development",
"FORCE_COLOR": "10"
},
//"outputCapture": "std",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen"
},
For a little background on my application: I use VS Code to run my JavaScript (now TypeScript) Node-JS backend in VS Code for development and debugging. F5/Start starts my main backend processes for debug (consuming local CPU) and I would love to be able to Stop/Restart these processes simply (including those run by nodemon). This process launching/restarting/stopping is equivalent to that performed by PM2 on my production server and indeed my VS Code launch config and PM2 launch config are similar.
I have a gateway development server in the cloud which, apart from an Apache reverse proxy and other security stuff, serves no purpose other than to tunnel web traffic to and from my VS Code-hosted backend being developed/debugged on my local machine. I use a VS Code on-folder-open task to set up a tunnel ("ssh -N -R 8080:localhost:8080 -R 3000:localhost:3000 ubuntu@xxx") to the gateway server and other local setup tasks (e.g. launch redis service).
This is a great way to develop a backend and I have plans for extending this setup to accommodate some Swift processes I am hoping to integrate in my backend (surprising choice I know but will allow code reuse and data schema sharing with my iOS app).
I am slowly requesting the missing features to make this setup work really well.... I love the fact VS Code really enables such a setup so thanks a bunch.
Ya annoying starting client server then having to close them 1 by 1 slowly.
You can work around it with postdebug hack so that closing 1 of them closes all of them, heres mine if you need a starting point for that route, but ya not pretty, better than clicking the button 5 times like some kind of babboon tho imo
//launch.json : (put this in all the things that get launched at once)
"postDebugTask": "KillProcs",
//...
//tasks.json, replace the % js% or js.* with something thats in the CommandLine of the process you need to kill, i used js because all my processes happen to have js in the command line start
{
"label": "KillProcs",
"type": "shell",
"command": "wmic Path win32_process Where \\\"CommandLine Like '% js%'\\\" Call Terminate",
"linux": {"command": "pkill -f ' js.*'"},
"problemMatcher": [],
"presentation": {
"echo": false,
"reveal": "never",
"focus": false,
"panel": "shared"
}
Thanks Macromaniac, I'm on Mac but appreciate the reply. Agree these kind of hacks are a workaround.
There is now a stopAll flag in the compound configurations which controls this behavior.
This was introduced by @connor4312 I believe
Due to that closing this issue
Most helpful comment
we need to resolve this.