instance method
IO#check_winsize_changed
() { () -> void } -> self
io.check_winsize_changed { ... } → io
ext/io/console/console.c
View on GitHub ↗
static VALUE
console_check_winsize_changed(VALUE io)
{
HANDLE h;
DWORD num;
h = (HANDLE)rb_w32_get_osfhandle(GetReadFD(io));
while (GetNumberOfConsoleInputEvents(h, &num) && num > 0) {
INPUT_RECORD rec;
if (ReadConsoleInput(h, &rec, 1, &num)) {
if (rec.EventType == WINDOW_BUFFER_SIZE_EVENT) {
rb_yield(Qnil);
}
}
}
return io;
}
Yields while console input events are queued.
This method is Windows only.
You must require ‘io/console’ to use this method.