Skip to content

tui v2: question prompt steals input from command palette #39252

Description

@damnsamn

Summary

In the V2 TUI, the visible command palette and an incoming question prompt compete for keyboard input. The palette remains open and visually topmost, but question-mode bindings consume keys, leaving the visible modal and keyboard owner out of sync.

Environment

  • opencode version: 0.0.0-next-16339
  • OS: Darwin 25.5.0, arm64
  • Terminal: Ghostty (TERM_PROGRAM=ghostty, COLORTERM=truecolor); independently reproduced in a private standalone TUI under tmux
  • Shell: /bin/zsh
  • Install/channel: opencode2, next
  • Active plugins: none found in project or user config

Reproduction

  1. Start a task that causes the assistant to invoke the question tool after a delay.
  2. Open the command palette with Ctrl+P before the question is presented.
  3. Wait for the question to appear behind the palette.
  4. Press Esc once.
  5. Separately, allow a question to become active first and then press Ctrl+P.

Expected Behavior

The topmost visible UI should exclusively own keyboard input. An incoming question should either wait, close or suspend the command palette before taking focus, or remain inactive until the palette closes.

When a question is already active, Ctrl+P should either open the command palette or provide clear modal behavior rather than being silently consumed.

Actual Behavior

If the command palette is open when the question arrives, the palette stays visible over the dimmed question UI, but the question captures keyboard input. Pressing Esc once cancels the question while leaving the visible command palette open.

In the inverse order, pressing Ctrl+P while a question is active does not open the command palette because the question UI consumes the shortcut.

Additional Context

This is consistently reproducible. It was independently reproduced on 0.0.0-next-16339 in a private standalone TUI under tmux with a deterministic delayed question:

  1. Prompt the agent to run sleep 5, then invoke the question tool.
  2. Open Commands with Ctrl+P while sleep 5 is running.
  3. When the question arrives, Commands remains visibly open over Questions.
  4. Press Esc; Questions is dismissed and Commands remains open.

Related reports:

No workaround has been identified beyond avoiding the command palette while a question may arrive.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions