End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
IO#console_mode=
io.console_mode = mode
ext/io/console/console.c
View on GitHub ↗
static VALUE
console_conmode_set(VALUE io, VALUE mode)
{
conmode *t, r;
rb_io_t *fptr;
int fd;
TypedData_Get_Struct(mode, conmode, &conmode_type, t);
r = *t;
GetOpenFile(io, fptr);
fd = GetReadFD(fptr);
if (!setattr(fd, &r)) sys_fail_fptr(fptr);
return mode;
}
Sets the console mode to mode.
You must require ‘io/console’ to use this method.