[READ-ONLY] Mirror of https://github.com/bombshell-dev/clack. Effortlessly build beautiful command-line apps bomb.sh/docs/clack/basics/getting-started/
cli command-line command-line-app node prompt prompts
5

Configure Feed

Select the types of activity you want to include in your feed.

fix: uv_tty_init error on Windows (#235)

authored by

翠 / green and committed by
Nate Moore
(Mar 30, 2025, 4:43 PM -0500) f5742976 3c200ddb

+9 -3
+5
.changeset/lemon-monkeys-help.md
··· 1 + --- 2 + "@clack/core": patch 3 + --- 4 + 5 + Fix "TTY initialization failed: uv_tty_init returned EBADF (bad file descriptor)" error happening on Windows for non-tty terminals.
+4 -3
packages/core/src/prompts/prompt.ts
··· 1 1 import { stdin, stdout } from 'node:process'; 2 2 import readline, { type Key, type ReadLine } from 'node:readline'; 3 - import type { Readable, Writable } from 'node:stream'; 4 - import { WriteStream } from 'node:tty'; 3 + import type { Readable } from 'node:stream'; 4 + import { Writable } from 'node:stream'; 5 5 import { cursor, erase } from 'sisteransi'; 6 6 import wrap from 'wrap-ansi'; 7 7 ··· 133 133 ); 134 134 } 135 135 136 - const sink = new WriteStream(0); 136 + const sink = new Writable(); 137 137 sink._write = (chunk, encoding, done) => { 138 138 if (this._track) { 139 139 this.value = this.rl?.line.replace(/\t/g, ''); ··· 150 150 tabSize: 2, 151 151 prompt: '', 152 152 escapeCodeTimeout: 50, 153 + terminal: true, 153 154 }); 154 155 readline.emitKeypressEvents(this.input, this.rl); 155 156 this.rl.prompt();