Task

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



Related task

   Check input device is a terminal


let () =
  print_endline (
    if Unix.isatty Unix.stdout
    then "Output goes to tty."
    else "Output doesn't go to tty."
  )