From cd3f2412e8346d1f20a9b49ef8e2a3aecc919d64 Mon Sep 17 00:00:00 2001 From: Sebastian Herrlinger Date: Fri, 12 Dec 2025 22:43:43 +0100 Subject: [PATCH] only exit app when prompt is empty, otherwise fallthrough, fix #5457 --- .../opencode/src/cli/cmd/tui/component/prompt/index.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx b/packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx index 53ce04353e..941b383e64 100644 --- a/packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx +++ b/packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx @@ -732,8 +732,12 @@ export function Prompt(props: PromptProps) { return } if (keybind.match("app_exit", e)) { - await exit() - return + if (store.prompt.input === "") { + await exit() + // Don't preventDefault - let textarea potentially handle the event + e.preventDefault() + return + } } if (e.name === "!" && input.visualCursor.offset === 0) { setStore("mode", "shell")