Skip to content

Commit d0a4088

Browse files
author
金双
committed
fix: make process.exit(0) Windows-only in TUI handler
The unconditional process.exit(0) at the end of the TUI handler causes the Linux CI test to fail. On non-Windows platforms, the index.ts finally{} safety-net handles process exit. Only Windows needs the explicit exit because the worker is not terminated there.
1 parent 9c5a8f7 commit d0a4088

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

packages/opencode/src/cli/cmd/tui/thread.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,10 @@ export const TuiThreadCommand = cmd({
244244
} finally {
245245
unguard?.()
246246
}
247-
process.exit(0)
247+
// On Windows we cannot await the worker shutdown or call
248+
// worker.terminate() — both destroy the console window. The worker
249+
// is still alive so the event loop won't drain; force-exit here.
250+
// On other platforms the index.ts finally{} safety-net handles exit.
251+
if (process.platform === "win32") process.exit(0)
248252
},
249253
})

0 commit comments

Comments
 (0)