Add a built-in command "quit" and process ctrl-d and eof cases.