mirror of
https://github.com/garrytan/gstack.git
synced 2026-05-19 19:02:29 +08:00
fix: use stdio array format for Bun Windows compatibility
Bun on Windows requires stdio as ['ignore','ignore','ignore'] array, not 'ignore' string. Fixes #448, #454, #458. Closes #444. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -234,9 +234,9 @@ async function startServer(): Promise<ServerState> {
|
|||||||
const launcherCode =
|
const launcherCode =
|
||||||
`const{spawn}=require('child_process');` +
|
`const{spawn}=require('child_process');` +
|
||||||
`spawn(process.execPath,[${JSON.stringify(NODE_SERVER_SCRIPT)}],` +
|
`spawn(process.execPath,[${JSON.stringify(NODE_SERVER_SCRIPT)}],` +
|
||||||
`{detached:true,stdio:'ignore',env:Object.assign({},process.env,` +
|
`{detached:true,stdio:['ignore','ignore','ignore'],env:Object.assign({},process.env,` +
|
||||||
`{BROWSE_STATE_FILE:${JSON.stringify(config.stateFile)}})}).unref()`;
|
`{BROWSE_STATE_FILE:${JSON.stringify(config.stateFile)}})}).unref()`;
|
||||||
Bun.spawnSync(['node', '-e', launcherCode], { stdio: 'ignore' });
|
Bun.spawnSync(['node', '-e', launcherCode], { stdio: ['ignore', 'ignore', 'ignore'] });
|
||||||
} else {
|
} else {
|
||||||
// macOS/Linux: Bun.spawn + unref works correctly
|
// macOS/Linux: Bun.spawn + unref works correctly
|
||||||
proc = Bun.spawn(['bun', 'run', SERVER_SCRIPT], {
|
proc = Bun.spawn(['bun', 'run', SERVER_SCRIPT], {
|
||||||
|
|||||||
Reference in New Issue
Block a user