feat: add Stdin.isRaw property to query and set terminal raw mode on stdin
Add foreign static getter `isRaw` and setter `isRaw=(value)` to the Stdin class, backed by a new `isStdinRaw` boolean flag and `uv_tty_set_mode` calls. The getter returns the current raw mode state, while the setter initializes the stdin stream if needed and applies raw or normal mode only when stdin is a TTY. Also includes a test file verifying default false, reading bytes in normal mode, enabling raw mode, and reading subsequent bytes.
This commit is contained in:
@@ -4,6 +4,18 @@ The standard input stream.
|
||||
|
||||
## Static Methods
|
||||
|
||||
### **isRaw**
|
||||
|
||||
Returns `true` if stdin is in raw mode. When in raw mode, input is not echoed
|
||||
or buffered, and all characters, even non-printing and control characters go
|
||||
into stdin.
|
||||
|
||||
Defaults to `false`.
|
||||
|
||||
### **isRaw**=(value)
|
||||
|
||||
Sets raw mode on or off.
|
||||
|
||||
### **readByte**()
|
||||
|
||||
Reads one byte of input from stdin. Blocks the current fiber until a byte has
|
||||
|
||||
Reference in New Issue
Block a user