Merge c1b36fa845c4257cba55203b3770e8727bf29dd7 into 608461c04cf74cbf27b47f9916e10e225cbfe8f1

This commit is contained in:
Praveens-Pepper-AI 2026-08-19 00:31:07 +02:00 committed by GitHub
commit f1d145cab0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -159,7 +159,10 @@ export function startElectron(root: string | undefined): ChildProcess {
const entry = process.env.ELECTRON_ENTRY || '.'
const ps = spawn(electronPath, [entry].concat(args), { stdio: 'inherit' })
ps.on('close', process.exit)
// `code` is null when the child was terminated by a signal, and `process.exit` ignores
// its second argument, so passing the listener directly would report every crash as a
// successful exit. Map a signal death to a non-zero status instead.
ps.on('close', (code, signal) => process.exit(code ?? (signal ? 1 : 0)))
return ps
}