feat(coding-agent): add /quit and /exit slash commands to exit (#426)

Add new slash commands for gracefully exiting the interactive mode:
- /quit - exit the application
- /exit - alias for /quit (common CLI convention)

Both commands await shutdown() which emits session_shutdown events
to hooks and custom tools before exiting. Unlike Ctrl+C (twice) which
uses void (fire-and-forget), these commands properly wait for hooks
and tools to complete their shutdown handlers.
This commit is contained in:
Ben Vargas 2026-01-03 14:38:55 -07:00 committed by GitHub
parent d6c39655e6
commit 8f5466f42a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -891,6 +891,11 @@ export class InteractiveMode {
this.editor.setText("");
return;
}
if (text === "/quit" || text === "/exit") {
this.editor.setText("");
await this.shutdown();
return;
}
// Handle bash command (! for normal, !! for excluded from context)
if (text.startsWith("!")) {