Skip to content

Dialogs should keep keyboard focus when a question prompt appears #29999

Closed as not planned

Description

@leo0o7

Description

Describe the bug

When a modal dialog is already open and the TUI enters question mode, keypresses that should control the dialog can be handled by the question prompt instead.

For example, if the command palette is open and a question prompt becomes active, keys intended for the command palette can contribute to answering the question rather than navigating or selecting inside the command palette.

Global leader shortcuts can also remain active while a dialog is open. For example, pressing the leader key inside the command palette can still start a global leader sequence, and matching follow-up keys can dispatch app/session commands from inside the dialog.

Expected behavior

When a modal dialog is open, the dialog should own keyboard input.

Question-mode bindings should not handle keys before the active dialog gets a chance to handle them, and app/session global shortcuts should not run from inside an open dialog.

Actual behavior

Question-mode bindings can handle keypresses even though a modal dialog is already open.

Global leader shortcuts can also still be triggered while a dialog is open.

Plugins

No response

OpenCode version

1.15.12

Steps to reproduce

For question prompt:

  1. Start a session where the assistant will ask a question.
  2. Open a dialog, such as the command palette, before the question is asked.
  3. Press keys that should interact with the dialog.

For global leader inside dialog:

  1. Open a dialog, such as the command palette.
  2. Press the global leader key.
  3. Press a matching leader continuation.

Screenshot and/or share link

No response

Operating System

macOS 15.6.1

Terminal

WezTerm

Activity

  1. github-actions commented on May 30, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    • Question Tool Keyboard Conflict and Agent Switch Issue #7496: Question Tool Keyboard Conflict and Agent Switch Issue — describes a similar keyboard event bubbling problem where question-mode keypresses conflict with other TUI components (tab key not consumed by QuestionPrompt, triggering agent switch instead)

    For keybind-related issues, please also check our pinned keybinds documentation: #4997

  2. kommander commented on May 30, 2026

    @kommander
    Contributor

    Yes, the dialog keymap layers need higher priority. I'll fix that.

  3. leo0o7 commented on May 30, 2026

    @leo0o7
    Author

    Thanks! I opened PR #30000 for this in case it's useful. Happy to adjust it based on your review.

  4. rekram1-node commented on Jun 23, 2026

    @rekram1-node
    Contributor

    Automated: closing question issues.

    GitHub Issues are for bug reports and feature requests only — questions / support are no longer tracked here.

    If this is a bug or feature request, please open a new issue with the appropriate template.

  5. rekram1-node commented on Jun 23, 2026

    @rekram1-node
    Contributor

    Reopening – this was incorrectly closed by automated question-issue cleanup. Sorry for the noise.

  6. github-actions commented on Aug 23, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions