End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
IO#noecho
io.noecho {|io| }
ext/io/console/console.c
View on GitHub ↗
static VALUE
console_noecho(VALUE io)
{
return ttymode(io, rb_yield, io, set_noecho, NULL);
}
Yields self with disabling echo back.
Example
STDIN.noecho(&:gets)
will read and return a line without echo back.
You must require ‘io/console’ to use this method.