summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorSebastian Herrlinger <[email protected]>2025-12-12 22:43:43 +0100
committerSebastian Herrlinger <[email protected]>2025-12-12 22:45:28 +0100
commit43202f2820d64f55b710c9257b73888c3954cf4e (patch)
tree03901702aaacb94f2053be9c6b06e2549f52803d
parentce37e11bfea70d02793c960da06f856fc5221c9b (diff)
downloadopencode-43202f2820d64f55b710c9257b73888c3954cf4e.tar.gz
opencode-43202f2820d64f55b710c9257b73888c3954cf4e.zip
only exit app when prompt is empty, otherwise fallthrough, fix #5457
-rw-r--r--packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx8
1 files 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 669ed1897..1ea701c83 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")