Skip to content

Commit 43202f2

Browse files
committed
only exit app when prompt is empty, otherwise fallthrough, fix anomalyco#5457
1 parent ce37e11 commit 43202f2

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

  • packages/opencode/src/cli/cmd/tui/component/prompt

‎packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -732,8 +732,12 @@ export function Prompt(props: PromptProps) {
732732
return
733733
}
734734
if (keybind.match("app_exit", e)) {
735-
await exit()
736-
return
735+
if (store.prompt.input === "") {
736+
await exit()
737+
// Don't preventDefault - let textarea potentially handle the event
738+
e.preventDefault()
739+
return
740+
}
737741
}
738742
if (e.name === "!" && input.visualCursor.offset === 0) {
739743
setStore("mode", "shell")

0 commit comments

Comments
 (0)