fix: pass signals to electron process

This commit is contained in:
Liam Mitchell 2025-07-08 13:07:03 +02:00
parent 1eeb15ea77
commit 96a25bb346

View File

@ -161,5 +161,13 @@ export function startElectron(root: string | undefined): ChildProcess {
const ps = spawn(electronPath, [entry].concat(args), { stdio: 'inherit' }) const ps = spawn(electronPath, [entry].concat(args), { stdio: 'inherit' })
ps.on('close', process.exit) 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 return ps
} }