Task

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



Related task

   Check output device is a terminal


File.new("testfile").tty?   #=> false
File.new("/dev/tty").tty?   #=> true
STDIN.tty?  #=> true