pqwy/notty

`pending` seems to not work using unix backend

Closed this issue · 1 comments

I tried to write something like:

(* main loop …*)
   render;
   while Notty_unix.Term.pending() do
     match Notty_unix.Term.event () withdone

but the code would never process any event. If I remove the pending() loop, the whole UI becomes blocking, but works properly. However, that's not very convenient when one wants to both react to events, and draw some UI that can change in other ways (e.g. a clock).

pqwy commented

Pending will not interact with outside world, so you need event - while pending - do event done.

Like here for instance.

pending just checks if there are queued events, which means event will not block.