epoll_pwait returns immediately when waiting on raw tty input
I'm debugging crossterm
with their stderr
example. crossterm
on Unix sets STDIN
to raw mode (if isatty
, otherwise it opens /dev/tty
). Following what is done in termion
, I modified this so it opens env("TTY")
in raw mode, and saved the fd in a static so multiple gets of the fd return the same result. Then crossterm
uses mio
, which in turn sets up an epoll
fd. When it's time to read from the tty, mio
calls epoll_wait
in a loop with timeout = -1
. epoll_wait
returns immediately with zero events.
I have not looked into crossterm
's use of termios
, but I would assume it's ok.