fix: prevent Windows terminal popups with windowsHide option

Add windowsHide: true to all spawn/execFile calls in bin and server code
to prevent new console windows from appearing on Windows.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
ekko
2026-04-14 17:17:15 +08:00
parent 9dd5fca9f9
commit 2487e147ab
3 changed files with 16 additions and 2 deletions
+3
View File
@@ -86,6 +86,7 @@ function startDaemon(port) {
detached: true,
stdio: ['ignore', logStream, logStream],
env: { ...process.env, PORT: String(port) },
windowsHide: true,
})
child.on('error', (err) => {
@@ -199,6 +200,7 @@ function doUpdate() {
const child = spawn(isWin ? 'cmd' : 'sh', isWin ? ['/c', ...cmd.split(' ')] : ['-c', cmd], {
stdio: 'inherit',
windowsHide: true,
})
child.on('exit', (code) => {
@@ -235,6 +237,7 @@ switch (command) {
const child = spawn(process.execPath, [serverEntry], {
stdio: 'inherit',
env: { ...process.env, PORT: String(port) },
windowsHide: true,
})
child.on('exit', (code) => process.exit(code ?? 1))
process.on('SIGTERM', () => child.kill('SIGTERM'))