Skip to content
instance method

IO#tty?

() -> bool
tty?

Alias of #isatty

Returns true if the stream is associated with a terminal device (tty), false otherwise:

Example
f = File.new('t.txt').isatty    #=> false
f.close
f = File.new('/dev/tty').isatty #=> true
f.close
See also #isatty #to_path #ttyname #to_io also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0