Skip to content

Commit 53dc493

Browse files
committed
fix: Add windows support
1 parent 3d663a5 commit 53dc493

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,15 @@ export const TuiThreadCommand = cmd({
6868
try {
6969
stdin = process.stdin.isTTY
7070
? process.stdin
71-
: new tty.ReadStream((await fs.open("/dev/tty", "r")).fd)
71+
: new tty.ReadStream(
72+
process.platform === "win32"
73+
? (await fs.open("CONIN$", "rw", 0o644)).fd
74+
: (await fs.open("/dev/tty", "r")).fd
75+
)
7276
} catch (err) {
73-
console.error("Failed to open /dev/tty for input. Prompt piping from stdin might not be supported on your platform.")
77+
console.error(
78+
"Failed to open TTY for input. Prompt piping from stdin might not be supported on your platform.",
79+
)
7480
process.exit(1)
7581
}
7682

0 commit comments

Comments
 (0)