Skip to content

[Bug] Question dialog blocks all messages_page_* keybinds in v1.15.9+ (regressed from v1.15.7) #29620

@rafaelsmgomes

Description

@rafaelsmgomes

Description

In v1.15.9 and later, the question/select dialog completely swallows every keybind defined in OPENCODE_BASE_MODE. When a question prompt is active you can no longer scroll the message view at all — neither the literal PageUp/PageDown keys nor any custom remap (e.g. messages_page_up: ctrl+u, messages_page_down: ctrl+d).

This is a regression from v1.15.7 (and earlier). Related issue #23897 reported a narrower variant of the same problem on v1.14.20: at that time ctrl+u (messages_*_up) still worked while the dialog was open and only ctrl+d was hijacked (because app_exit defaults include ctrl+d). In v1.15.9+ both directions are dead, suggesting whatever changed in v1.15.9's "Restore question prompt key handling" commit widened the suppression to all base-mode bindings.

Version-by-version behavior (macOS arm64)

Version PageUp/PageDown while question open ctrl+u/ctrl+d remap while question open
1.14.20 scrolls messages (works) ctrl+u works; ctrl+d cancels question (#23897)
1.15.7 scrolls messages (works) scrolls messages (works)
1.15.9 dead (no action) dead (no action)
1.15.10 dead dead
1.15.11 dead dead

v1.15.9 changelog entry: "Restore question prompt key handling" — likely the change that regressed the fall-through.

Hypothesis (root cause)

The QuestionPrompt component pushes QUESTION_MODE onto the mode stack via useOpencodeModeStack and registers useBindings({ mode: QUESTION_MODE, enabled: !store.editing, ... }). While QUESTION_MODE is active, unhandled keys do not fall through to OPENCODE_BASE_MODE where messages_page_up, messages_page_down, messages_half_page_up, messages_half_page_down, messages_line_up, and messages_line_down live.

Expected behavior: keys not consumed by QUESTION_MODE should propagate to OPENCODE_BASE_MODE (vim/nvim style mode cascading), so message-view scroll commands remain reachable while answering a prompt.

(Bug reproduces with --pure as well — plugins are not involved.)

OpenCode version

1.15.11 (also confirmed broken on 1.15.10 and 1.15.9)

Steps to reproduce

  1. Use this tui.json (the broken behavior also reproduces with default keybinds, but the remap makes it obvious):

    {
      "$schema": "https://opencode.ai/tui.json",
      "keybinds": {
        "messages_page_up": "ctrl+u",
        "messages_page_down": "ctrl+d",
        "app_exit": "ctrl+c,<leader>q"
      }
    }

    (Removing ctrl+d from app_exit is required to isolate the scroll regression from the older #23897 cancel behavior.)

  2. Start a session and prompt the agent to ask you a question (any flow that triggers the question tool — e.g. plan-mode confirmation, multi-choice prompt).

  3. While the question dialog is rendered at the bottom of the TUI, press PageUp, PageDown, ctrl+u, and ctrl+d (and the default fallbacks ctrl+alt+b, ctrl+alt+f).

Expected: message view scrolls.

Actual: nothing happens. All keys are swallowed by the question dialog mode.

Operating System

macOS 26.5 (build 25F71), Apple Silicon (arm64)

Terminal

Ghostty (with tmux 3.6a)

Related

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions