End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
IO#raw!
io.raw!(min: nil, time: nil, intr: nil) → io
ext/io/console/console.c
View on GitHub ↗
static VALUE
console_set_raw(int argc, VALUE *argv, VALUE io)
{
conmode t;
rb_io_t *fptr;
int fd;
rawmode_arg_t opts, *optp = rawmode_opt(&argc, argv, 0, 0, &opts);
GetOpenFile(io, fptr);
fd = GetReadFD(fptr);
if (!getattr(fd, &t)) sys_fail_fptr(fptr);
set_rawmode(&t, optp);
if (!setattr(fd, &t)) sys_fail_fptr(fptr);
return io;
}
Enables raw mode, and returns io.
If the terminal mode needs to be back, use io.raw { ... }.
See IO#raw for details on the parameters.
You must require ‘io/console’ to use this method.