Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debug: is there a way to terminate preLaunchTask process (when debug stops)? #12315

Closed
yanivefraim opened this issue Sep 20, 2016 · 5 comments
Closed
Assignees
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues *duplicate Issue identified as a duplicate of another issue(s) feature-request Request for new features or functionality

Comments

@yanivefraim
Copy link

Steps to Reproduce:

I am debugging my server (node) code and I added a "start cdn server" preLaunchTask. This task is starting an express server which serves my static files (I want to be able to open my browser and enter server code in debug mode).

While it works fine, I want to be able to kill this cdn server process when debug stops. I was expecting the prelaunch task to be a child process of the debug process, which would solve my problem, but it isn't (it is a child process of VS Code).

Is there a reasonable solution to my problem?

@chrmarti
Copy link
Collaborator

You could launch a wrapper.js that first starts your cdn server and then the actual debugging target. That should make the cdn server a child process of the wrapper. Would that work for you?

@chrmarti chrmarti added the info-needed Issue requires more information from poster label Sep 20, 2016
@chrmarti chrmarti self-assigned this Sep 20, 2016
@yanivefraim
Copy link
Author

Thanks @chrmarti. I was thinking about a similar solution, the problem is that I'll have to spawn index.js from wrapper, which I found hard to debug.

I have several scenarios which I want to start a process (watch/cdn) before debug and kill it when debug ends. It would be nice if we can have some control (in the form of event?) or have the option to run pre launch task as child process

@chrmarti chrmarti added feature-request Request for new features or functionality and removed info-needed Issue requires more information from poster labels Sep 20, 2016
@chrmarti
Copy link
Collaborator

@yanivefraim You could probably also 'require' index.js from debug.js once the cdn server has started. That should allow you to debug index.js. Would that work?

Or: Let the cdn server check if the debug target is running and exit after 10s of not seeing it?

Maybe VS Code could check if the preLaunchTask is still running when the target exits and send it a signal (as you suggest). Will mark this as a feature request for that.

@yanivefraim
Copy link
Author

Thanks! I think this can be really helpfull

@chrmarti chrmarti assigned weinand and unassigned chrmarti Apr 17, 2017
@chrmarti chrmarti added the debug Debug viewlet, configurations, breakpoints, adapter issues label Apr 17, 2017
@weinand weinand assigned isidorn and unassigned weinand Apr 18, 2017
@isidorn
Copy link
Contributor

isidorn commented Apr 24, 2017

Dup of #11522
@chrmarti gives a nice workaround also

@isidorn isidorn closed this as completed Apr 24, 2017
@isidorn isidorn added the *duplicate Issue identified as a duplicate of another issue(s) label Apr 24, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues *duplicate Issue identified as a duplicate of another issue(s) feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

4 participants