library for single terminal i/o