Task

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



Related task

   Check output device is a terminal


if {[catch {fconfigure stdin -mode}]} {
    puts "Input doesn't come from tty."
} else {
    puts "Input comes from tty."
}