method

tty?

v1_8_6_287 - Show latest stable - Class: IO
tty?()
public

Returns true if ios is associated with a terminal device (tty), false otherwise.

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