fixes #6148 - exit cleanly when EOF/ctrl+d given in shell