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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user