Termisu::Reader
Constants
FD_SETSIZE limit for select(2). File descriptors >= this value cannot be used with select() and require poll() as a fallback.
Maximum retry attempts for EINTR before giving up. This prevents infinite loops in pathological signal storms.
Constructors
Instance methods
Checks if data is available for reading.
Uses select(2) with zero timeout for non-blocking check.
Peeks at the next byte, waiting at most timeout_ms for the file descriptor.
Buffered bytes remain visible after the timeout has expired.
Reads a single byte, waiting at most timeout_ms for the file descriptor.
Bytes already in the internal buffer are consumed even when the timeout is zero. This lets callers apply an absolute deadline without abandoning bytes that arrived in the same read as an earlier byte.
Reads a single byte from the input.
Returns nil if no data is available or on EOF.
This is a non-blocking operation when the terminal is in raw mode.
Reads exactly count bytes from the input.
Returns nil if fewer than count bytes are available.
Blocks until all bytes are read or timeout occurs.