mirror of
https://github.com/alex8088/electron-vite.git
synced 2026-06-28 05:18:10 +08:00
Spawn the Electron binary directly in dev/preview mode but forward SIGINT/SIGTERM/SIGHUP from the electron-vite parent to the child, matching Electron's own CLI wrapper (node_modules/electron/cli.js). Without this, Ctrl-C sends SIGINT to the foreground process group once: the Node parent exits immediately (no handler) and the Electron child gets only a single SIGINT. On macOS, an Electron app whose before-quit handler calls preventDefault() and later calls app.quit() can stall in AppKit's event loop in that path. Under a direct 'electron .' launch the CLI shim forwards SIGINT as well, so Electron gets it twice and exits cleanly. Matching that behavior here fixes the hang. Fixes #899