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:
@@ -0,0 +1,4 @@
|
||||
import "io" for Stdin
|
||||
|
||||
// The tests aren't run in a terminal.
|
||||
System.print(Stdin.isTerminal) // expect: false
|
||||
Reference in New Issue
Block a user