utility to read from a tty device