From 8f5466f42ab6d39e4a7b860b338c5752295e9d07 Mon Sep 17 00:00:00 2001 From: Ben Vargas Date: Sat, 3 Jan 2026 14:38:55 -0700 Subject: [PATCH] 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. --- .../coding-agent/src/modes/interactive/interactive-mode.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/coding-agent/src/modes/interactive/interactive-mode.ts b/packages/coding-agent/src/modes/interactive/interactive-mode.ts index 43e13c20..39f9882c 100644 --- a/packages/coding-agent/src/modes/interactive/interactive-mode.ts +++ b/packages/coding-agent/src/modes/interactive/interactive-mode.ts @@ -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("!")) {