Instead of quitting the application immediately when the pty gives an EOF, fire an on_command_exit hook so the TerminalWidget client can decide for himself what to do.