Task

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



Related task

   Check input device is a terminal


// Kotlin Native version 0.5
 
import platform.posix.*
 
fun main(args: Array<String>) {
    if (isatty(STDOUT_FILENO) != 0)
        println("stdout is a terminal")
    else
        println("stdout is not a terminal") 
}