fix(desktop): use stdio ignore for sidecar to prevent process hang on quit

Piped stdio handles kept the event loop alive on Windows after killing
the sidecar process, preventing the Electron app from exiting.
This commit is contained in:
2026-02-09 00:18:49 +08:00
parent ccf220fc29
commit 26b74b25f2

View File

@@ -69,16 +69,9 @@ const spawnServer = (port: number): string => {
PORT: String(port),
HOST: '127.0.0.1',
},
stdio: 'pipe',
})
serverProcess.stdout?.on('data', (data: Buffer) => {
console.log(`[server] ${data.toString().trim()}`)
})
serverProcess.stderr?.on('data', (data: Buffer) => {
console.error(`[server] ${data.toString().trim()}`)
stdio: 'ignore',
})
serverProcess.unref()
serverProcess.on('error', (err) => {
console.error('Failed to start server:', err)