While the former cleans up processeses, the latter does not. -- The cli sees ^D as CLI.execCommand(String cmd == null). The "quit" logic should be consolidated into the CLI class as a method so that both the EOF and the "quit" code can call it.