Skip to content

Commit 3c1a384

Browse files
committed
fix(tui): insert skill name without wiping existing prompt text
When selecting a skill from the TUI skill picker, the skill name is now inserted at the cursor position using input.insertText() instead of replacing the entire prompt with input.setText(). Previously, typing a question then selecting a skill would destructively wipe the entire prompt. Closes: #27578 Closes: #27160 Closes: #18756 Closes: #18755
1 parent 94564f3 commit 3c1a384

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

  • packages/opencode/src/cli/cmd/tui/component/prompt

packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -587,12 +587,9 @@ export function Prompt(props: PromptProps) {
587587
dialog.replace(() => (
588588
<DialogSkill
589589
onSelect={(skill) => {
590-
input.setText(`/${skill} `)
591-
setStore("prompt", {
592-
input: `/${skill} `,
593-
parts: [],
594-
})
595-
input.gotoBufferEnd()
590+
input.insertText(`/${skill} `)
591+
setStore("prompt", "input", input.plainText)
592+
syncExtmarksWithPromptParts()
596593
}}
597594
/>
598595
))

0 commit comments

Comments
 (0)