Change terminal modes, and perform non-blocking reads
