mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-11 02:03:59 +08:00
Three gaps on pi-tui's terminal start path:
- `if (process.stdin.setRawMode)` read the method as a value (SC2020).
The read now answers the stream object's member: the method on a TTY,
undefined otherwise, as on Node.
- process.stdin.setEncoding had no runtime method, and a string 'data'
listener was fenced. stdin now decodes with the shared StringDecoder
once per read (split multibyte sequences stay whole, end() flushes the
tail before 'end'), string listeners receive the text, and dynamic
listeners receive what Node delivers. A string listener with no
encoding set throws the setEncoding-state TypeError, as child streams
do.
- process.stdout.on("resize", cb) (once/off/removeListener, stderr too)
registers on the stream object, which listens for SIGWINCH and emits
when a TTY's size changed; the listener never keeps the loop alive.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>