فهرست منبع

fix(tui): resize textarea if text inserted via `appendPrompt` TUI API (#5983)

Josh Thomas 4 ماه پیش
والد
کامیت
10745d5bef
1فایلهای تغییر یافته به همراه5 افزوده شده و 0 حذف شده
  1. 5 0
      packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx

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

@@ -310,6 +310,11 @@ export function Prompt(props: PromptProps) {
 
   sdk.event.on(TuiEvent.PromptAppend.type, (evt) => {
     input.insertText(evt.properties.text)
+    setTimeout(() => {
+      input.getLayoutNode().markDirty()
+      input.gotoBufferEnd()
+      renderer.requestRender()
+    }, 0)
   })
 
   createEffect(() => {