When STDIN is tty, read only one line. If not, read all the lines.