Apparently we cannot guarantee that a terminal will define eof().