Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →
instance method
IO::generic_readable#getpass
io.getpass(prompt=nil) → string
ext/io/console/console.c
View on GitHub ↗
static VALUE
io_getpass(int argc, VALUE *argv, VALUE io)
{
VALUE str;
rb_check_arity(argc, 0, 1);
prompt(argc, argv, io);
rb_check_funcall(io, id_flush, 0, 0);
str = rb_ensure(gets_call, io, puts_call, io);
return str_chomp(str);
}
See IO#getpass.