فهرست منبع

fix(tui): suspend agent tab keybinds in shell mode

Kit Langton 1 ماه پیش
والد
کامیت
c1ef03d53d
1فایلهای تغییر یافته به همراه15 افزوده شده و 0 حذف شده
  1. 15 0
      packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx

+ 15 - 0
packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx

@@ -98,6 +98,21 @@ export function Prompt(props: PromptProps) {
   const pasteStyleId = syntax().getStyleId("extmark.paste")!
   let promptPartTypeId = 0
 
+  createEffect(
+    on(
+      () => store.mode,
+      (mode, prev) => {
+        if (prev === "shell") command.keybinds(true)
+        if (mode === "shell") command.keybinds(false)
+      },
+      { defer: true },
+    ),
+  )
+
+  onCleanup(() => {
+    if (store.mode === "shell") command.keybinds(true)
+  })
+
   sdk.event.on(TuiEvent.PromptAppend.type, (evt) => {
     if (!input || input.isDestroyed) return
     input.insertText(evt.properties.text)