diff options
| author | Sebastian <[email protected]> | 2026-04-02 23:20:56 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-04-02 23:20:56 +0200 |
| commit | 6e1400fc455f71203a5c15ad64b8c0bb73211290 (patch) | |
| tree | 4315d9ceef9c0813e694a1821d157afb1e72e356 /packages | |
| parent | bf26c08d5197deee510813561445fa364ffc4a9d (diff) | |
| download | opencode-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.tsx | 11 |
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(() => { |
