diff --git a/src/electron.ts b/src/electron.ts index 73c4966..153075b 100644 --- a/src/electron.ts +++ b/src/electron.ts @@ -161,5 +161,13 @@ export function startElectron(root: string | undefined): ChildProcess { const ps = spawn(electronPath, [entry].concat(args), { stdio: 'inherit' }) ps.on('close', process.exit) + for (const signal of ['SIGINT', 'SIGTERM', 'SIGUSR2'] as NodeJS.Signals[]) { + process.on(signal, () => { + if (!ps.killed) { + ps.kill(signal) + } + }) + } + return ps }