Check input device is a terminal

say $*IN.t ?? "Input comes from tty." !! "Input doesn't come from tty.";

Output:

$ raku istty.raku
Input comes from tty.
$ true | raku istty.raku
Input doesn't come from tty.

Last updated