Wait for input on one of the streams in ListOfStreams and return
a list of streams on which input is available in ReadyList.
wait_for_input/3 waits for at most TimeOut seconds.
Timeout may be specified as a floating point number to specify
fractions of a second. If Timeout equals 0, wait_for_input/3
waits indefinetely. This predicate can be used to implement
timeout while reading and to handle input from multiple sources. The
following example will wait for input from the user and an
explicitely opened second terminal. On return, Inputs may hold
user
or P4 or both.
?- open('/dev/ttyp4', read, P4),
wait_for_input([user, P4], Inputs, 0).