isTTY

Determines whether or not the program is being run in a terminal (virtual TTY).

"isatty() returns 1 if fd is an open file descriptor referring to a terminal; otherwise 0 is returned, and errno is set to indicate the error."

  1. bool isTTY()
    version(Posix)
    @safe
    bool
    isTTY
    ()
  2. bool isTTY()

Return Value

Type: bool

true if the current environment appears to be a terminal; false if not (e.g. pager or certain IDEs with terminal windows).