TTYUI is a tiny set of helpers for terminal character I/O. It implements common set of terminal input handlers such as:
For more detail, see the documentation.