method

tty?

v1_8_7_330 - 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