fix: remove killed check to allow multiple signals (#40667)

* fix: remove `killed` check to allow multiple signals

* fix: signal forwarding
This commit is contained in:
Ruben R
2025-10-23 14:20:04 -05:00
committed by GitHub
parent 418b8235bc
commit 00e01e0e82
2 changed files with 10 additions and 3 deletions

View File

@@ -5,11 +5,15 @@ const utils = require('./lib/utils');
const electronPath = utils.getAbsoluteElectronExec();
const child = cp.spawn(electronPath, process.argv.slice(2), { stdio: 'inherit' });
child.on('close', (code) => process.exit(code));
let childClosed = false;
child.on('close', (code) => {
childClosed = true;
process.exit(code);
});
const handleTerminationSignal = (signal) =>
process.on(signal, () => {
if (!child.killed) {
if (!childClosed) {
child.kill(signal);
}
});