-
Notifications
You must be signed in to change notification settings - Fork 27
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
unref() doesn't seem to work #16
Comments
OK I realize now that unref() only helps with the event loop. What I want is to set the "detached" option on the child process, so that even if Node goes down, the child (in my case firefox) stays up. |
Hello @Sidewinder1138 IIRC I had this kind of issue with my module (biased-opener, which used to use opener, but since I switched to browser-launcher) and I solved it with:
https://github.com/jakub-g/biased-opener/blob/master/index.js#L78-L83 Right now when the browser is opened, it becomes independent on the opening node process. I also pass Hope that helps |
This seems pretty well-documented in the readme ("Plus, it returns the child process created, so you can do things like let your script exit while the window stays open:") |
Opener is working great for launching my browser from my node script. But the problem I'm having is that if I kill node (via ctrl-c in the console), then my browser goes down with it! (In this case firefox on linux). I tried calling unref() like in your example but it doesn't seem to help, firefox just dies along with node.
I'm assuming that I'm doing something dumb, but could really use help figuring this out. Seems that everyone would want the child process to stay running, maybe that should be the default behavior?
The text was updated successfully, but these errors were encountered: