Support Ctrl-D to terminate session