Files
paseo/packages/desktop/scripts/dev-runner-config.mjs
T
Mohamed BoudraandGitHub 2f6b585a3a fix(desktop): shut down cleanly with workspace terminals (#3268)
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.
2026-08-12 13:00:55 +02:00

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"));
}
}