Ver Fonte

only exit app when prompt is empty, otherwise fallthrough, fix #5457

Sebastian Herrlinger há 2 meses atrás
pai
commit
43202f2820

+ 6 - 2
packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx

@@ -732,8 +732,12 @@ export function Prompt(props: PromptProps) {
                   return
                   return
                 }
                 }
                 if (keybind.match("app_exit", e)) {
                 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) {
                 if (e.name === "!" && input.visualCursor.offset === 0) {
                   setStore("mode", "shell")
                   setStore("mode", "shell")