fix(cli): prevent Node stdout EPIPE failures

Keep draining standalone server stdout after reading its readiness message so
later server output does not write into a closed pipe.

Install the Node CLI broken-pipe handler before loading the main entrypoint.
Ignore only EPIPE while preserving all unrelated stdout errors. This prevents
Windows Node builds from failing when the TUI prints its exit epilogue after
renderer teardown.
This commit is contained in:
Simon Klee
2026-07-17 14:46:46 +02:00
parent a1b274e6f8
commit 42e2dde739
2 changed files with 18 additions and 4 deletions
+7 -1
View File
@@ -1,3 +1,9 @@
import "./plugin-runtime.promise"
import "./plugin-runtime.effect"
import "../index"
process.stdout.on("error", (error) => {
if ("code" in error && error.code === "EPIPE") return
throw error
})
await import("../index")