Task

Demonstrate how to check whether the input device is a terminal or not.



Related task

   Check output device is a terminal


import std.stdio;
 
extern(C) int isatty(int);
 
void main() {
    if (isatty(0))
        writeln("Input comes from tty.");
    else
        writeln("Input doesn't come from tty.");
}