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 18384f65e010..8972ba36e842 100644 --- a/packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx +++ b/packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx @@ -930,6 +930,13 @@ export function Prompt(props: PromptProps) { pasteText(pastedContent, `[Pasted ~${lineCount} lines]`) return } + + // Force layout update and render for the pasted content + setTimeout(() => { + input.getLayoutNode().markDirty() + input.gotoBufferEnd() + renderer.requestRender() + }, 0) }} ref={(r: TextareaRenderable) => { input = r