Skip to content

fix(tui): preserve command keybinds while prompt suggestion is visible#160

Closed
ICOM725 wants to merge 8 commits into
XiaomiMiMo:mainfrom
ICOM725:fix/tui-keybind-suspend-narrow
Closed

fix(tui): preserve command keybinds while prompt suggestion is visible#160
ICOM725 wants to merge 8 commits into
XiaomiMiMo:mainfrom
ICOM725:fix/tui-keybind-suspend-narrow

Conversation

@ICOM725

@ICOM725 ICOM725 commented Jun 11, 2026

Copy link
Copy Markdown

Fixes #124
Refs #65

When a ghost prompt suggestion is visible, the prompt suspends command keybinds
so Tab can reach the textarea and accept the suggestion. The previous suspend
state was too broad for ghost suggestions — it also blocked unrelated shortcuts
like Ctrl+P (command palette), F-keys, and leader sequences.

Keep the existing full suspension mode for autocomplete, where Ctrl+P/Ctrl+N are
handled by the autocomplete list itself. Add a narrower input suspension mode for
ghost suggestions so only the prompt-owned keys (Tab to accept, Escape to dismiss)
fall through while the command palette shortcut keeps working.

Verification:

  • bun run --cwd packages/opencode typecheck
  • bun test test/cli/tui/keybind-plugin.test.ts (5 tests pass)

@qiaozongming

Copy link
Copy Markdown
Collaborator

#954

@qiaozongming

Copy link
Copy Markdown
Collaborator

#1107

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] 推荐 prompt 存在时 ctrl+p 无法唤出设置

5 participants