appendPrompt doesn't trigger textarea resize
Description
When calling appendPrompt() from a plugin, text is inserted but the textarea doesn't resize to fit the content. It stays at minimum height.
Root cause: appendPrompt uses input.insertText() which bypasses onContentChange where resize logic runs.
Workaround:
await ctx.client.tui.appendPrompt({ body: { text: fullPrompt } })
await ctx.client.tui.executeCommand({ body: { command: "session_new" } })
await new Promise(r => setTimeout(r, 200))
await ctx.client.tui.appendPrompt({ body: { text: fullPrompt } })
Suggested fix: Add a setPrompt API that uses the Prompt component's set method, which properly triggers resize.
OpenCode version
1.0.164
Steps to reproduce
- Create a plugin that calls
appendPromptaftersession_new - Run the plugin:
await ctx.client.tui.executeCommand({ body: { command: "session_new" } })
await new Promise(r => setTimeout(r, 500))
await ctx.client.tui.appendPrompt({ body: { text: "Multi-line\ntext\nthat\nshould\nexpand" } })
- Text appears but textarea stays 1 line tall
Screenshot and/or share link
No response
Operating System
Arch Linux
Terminal
Ghostty
Oops! I was working on this for opencode-handoff and running into this issue. I asked Opus to capture what was happening and it apparently decided that meant I wanted to capture it as an issue, not as a Markdown doc in the current directory. I'll provide some follow-up screenshots here shortly.
yeah I've seen this, it doesn't trigger a resize on paste as well when you have a smaller prompt than 2 lines it will just show one line it's mainly due to the update not being tracked properly I saw this when I was implementing the voice feature in one of my own sub-branches