Workspace terminal shutdown only signaled an npm wrapper, leaving Electron alive with broken output pipes. Make the signal-handling runner the terminal-owned process and route external Electron termination through the existing quit lifecycle.
24 lines
720 B
JavaScript
24 lines
720 B
JavaScript
export function createElectronSpawnOptions({ env, colorEnv, expoDevUrl }) {
|
|
return {
|
|
// Electron must stay in the runner's process group. Paseo workspace scripts
|
|
// own the terminal process group, so detaching Electron lets it survive a
|
|
// service stop with broken stdout/stderr pipes and block the next launch.
|
|
detached: false,
|
|
env: {
|
|
...env,
|
|
...colorEnv,
|
|
EXPO_DEV_URL: expoDevUrl,
|
|
},
|
|
};
|
|
}
|
|
|
|
export function resolveChildKillTarget(pid, detached) {
|
|
return detached ? -pid : pid;
|
|
}
|
|
|
|
export function registerDevRunnerShutdownSignals({ signalSource, stop }) {
|
|
for (const signal of ["SIGHUP", "SIGINT", "SIGTERM"]) {
|
|
signalSource.on(signal, () => stop("SIGTERM"));
|
|
}
|
|
}
|