fix demo readline terminal editing

This commit is contained in:
Yichen Jiang committed 2026-06-19 09:58:39 +08:00
1 parent c5049d1c3f
commit 5189c99543
6 files changed
+79 -3

No files matched your search

+5 -1
View File
@@ -53,7 +53,11 @@ export function apply(ctx: Context) {
})
ctx.effect(() => {
const reader = createInterface({ input: process.stdin })
const reader = createInterface({
input: process.stdin,
output: process.stdout,
terminal: process.stdin.isTTY && process.stdout.isTTY,
})
// Piped-input exit, once stdin reaches EOF:
// - If no line ever submitted work (empty stdin, blank-only lines), exit
// immediately — no turn will ever start, so there is nothing to wait