-
Notifications
You must be signed in to change notification settings - Fork 16.3k
Closed
Description
- Electron version: v0.37.7
- Operating system: Windows 10 (64-bit)
Hi,
In Node.js, listening for the SIGINT
event cancels its default behavior of exiting the process.
In Electron, the SIGINT
event handler is called but the process still exits ASAP so the event handler will be interrupted randomly while it's doing its thing. For instance, running the following with electron index.js
:
setTimeout(() => { /* Just to keep process running */ }, 1000000);
process.on("SIGINT", () => {
console.log("Caught SIGINT. Exiting in 5 seconds.");
setTimeout(() => {
console.log("This should appear in the Electron console but the process will be long killed.");
process.exit(0);
}, 5000);
});
Prints for instance Caug
or Caught S
on my PC right before exiting and the rest of the function doesn't get executed. I believe that's not intended behavior.
aqiongbei, Patronics, ArminEberle, vladpuz, TomasHubelbauer and 1 more