feat: add Stdin.isTerminal method to detect TTY connection
Add a new `isTerminal` static method to the Stdin class that returns `true` when stdin is connected to a TTY (interactive terminal) and `false` when input comes from a pipe. Implementation uses libuv's `uv_guess_handle` to check the stdin descriptor. Includes documentation, foreign method declaration, module registration, and a test expecting `false` since tests run non-interactively.
This commit is contained in:
@@ -16,6 +16,12 @@ Defaults to `false`.
|
||||
|
||||
Sets raw mode on or off.
|
||||
|
||||
### **isTerminal**
|
||||
|
||||
Returns `true` if Stdin is connected to a "TTY". This is true when the user is
|
||||
running Wren in an interactive terminal, and false if it its input is coming
|
||||
from a pipe.
|
||||
|
||||
### **readByte**()
|
||||
|
||||
Reads one byte of input from stdin. Blocks the current fiber until a byte has
|
||||
|
||||
Reference in New Issue
Block a user