gracefully handle EOF at the console (fix Issue#2)