Implement tty read, though it isn't tested.