Repository navigation
Commit 2cc7d83
committed
fix(opencode): prevent process.exit() from killing parent terminal on Windows
On Windows, process.exit() calls ExitProcess() which sends
CTRL_CLOSE_EVENT to the console, killing the parent terminal
(pwsh/cmd). This was exposed by the opentui dependency bump
(0.1.99 -> 0.1.103) in v1.14.25 which changed how the TUI
process terminates.
Fix by avoiding process.exit() entirely on Windows:
- In thread.ts: use process.exitCode = 0 and return instead
- In index.ts: set exitCode and let the event loop drain;
MCP subprocesses are already cleaned up by Effect finalizers
Closes anomalyco#286731 parent 45badf7 commit 2cc7d83
2 files changed
Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
283 | 283 | | |
284 | 284 | | |
285 | 285 | | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
286 | 292 | | |
287 | 293 | | |
288 | 294 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
137 | 146 | | |
138 | 147 | | |
139 | 148 | | |
| |||
0 commit comments