summaryrefslogtreecommitdiffhomepage
path: root/packages
diff options
context:
space:
mode:
authorSebastian <[email protected]>2026-04-02 23:20:56 +0200
committerGitHub <[email protected]>2026-04-02 23:20:56 +0200
commit6e1400fc455f71203a5c15ad64b8c0bb73211290 (patch)
tree4315d9ceef9c0813e694a1821d157afb1e72e356 /packages
parentbf26c08d5197deee510813561445fa364ffc4a9d (diff)
downloadopencode-6e1400fc455f71203a5c15ad64b8c0bb73211290.tar.gz
opencode-6e1400fc455f71203a5c15ad64b8c0bb73211290.zip
dialog aware prompt cursor (#20753)
Diffstat (limited to 'packages')
-rw-r--r--packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx11
1 files changed, 9 insertions, 2 deletions
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 0c55ef627..382bd2806 100644
--- a/packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx
+++ b/packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx
@@ -442,8 +442,15 @@ export function Prompt(props: PromptProps) {
})
createEffect(() => {
- if (props.visible !== false) input?.focus()
- if (props.visible === false) input?.blur()
+ if (!input || input.isDestroyed) return
+ if (props.visible === false || dialog.stack.length > 0) {
+ input.blur()
+ return
+ }
+
+ // Slot/plugin updates can remount the background prompt while a dialog is open.
+ // Keep focus with the dialog and let the prompt reclaim it after the dialog closes.
+ input.focus()
})
createEffect(() => {