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.
5 lines
110 B
Plaintext
5 lines
110 B
Plaintext
import "io" for Stdin
|
|
|
|
// The tests aren't run in a terminal.
|
|
System.print(Stdin.isTerminal) // expect: false
|