Skip to content

Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →

instance method

IO#ttyname

io.ttyname → string or nil

Returns name of associated terminal (tty) if io is a tty. Returns nil otherwise.

See also #tty? #ungetbyte #to_path #ungetc also in 4.0 · 3.4