Skip to content

Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →

class method

IO.console

() -> ::File?
(:close) -> nil
(::Symbol sym, *untyped args) -> untyped
IO.console → #<File:/dev/tty>
IO.console(sym, *args)

Returns an File instance opened console.

If sym is given, it will be sent to the opened console with args and the result will be returned instead of the console IO itself.

You must require ‘io/console’ to use this method.

See also .binwrite .copy_stream .binread .foreach also in 4.1 · 4.0 · 3.3 · 3.2 · 3.1 · 3.0