electron-userland / electron-userland/electron-webpack
Can't capture SIGINT when dev process is killed through git bash.
- Dominant language
- TypeScript
- Stars
- 902
- Forks
- 168
- PR merge metrics
- No merged PRs in 30d
Description
* **electron-webpack Version**: ^2.7.4
* **Target**: win32
I have an electron application that needs to spawn a sister java process and communicate with it over localhost / http to manage some jobs. I have some code that starts this process by running a .bat file with node JS's child_process.execFile api.
The crux of my issue is that I am ending up with zombie processes. I originally handled killing the zombie process this by having this snippet in my process's entry file:
~~~~
app.on('window-all-closed', (event) => {
event.preventDefault();
.... kill process code
});
~~~~
This essentially preventing the killing of the electron process until the child kill process code has finished killing all of the children. This approach worked. (I skipped the kill process code because it goes into using the tree-kill node module and uses a class etc.)
So the crux of my issue is that this works fine when just running electron and closing the application like a GUI application and closing it from there. However whenever I run `electron-webpack dev` and have to kill the process by sending CTRL+C or 'SIGINT' then this process never happens because the app event is never emitted. I tried listening on different app events as well as the node JS process object but nothing was captured when running electron-webpack dev.
Is there a better way to manage this? Currently I'm resorting to killing things in the task manager.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.