Skip to content

TUI: question dialog keyboard trapped after switching tabs while custom-answer field is focused #47624

Closed

Description

@felixarnold

Description

When a question dialog has multiple questions (tabs) and I'm typing a custom
"Type your own answer" reply, mouse-clicking another tab leaves the dialog stuck
in edit mode. Clicking the "Confirm" tab traps the keyboard completely: no
keypress does anything, including Esc. Only recovery is clicking a question tab
and pressing Esc to exit edit mode.

Cause: selectTab() in packages/tui/src/cli/cmd/tui/routes/session/question.tsx
changes the tab without resetting store.editing, which disables both keymap
blocks (editing keymap requires !confirm(), navigation keymap requires
!editing). The CLI footer handles this correctly via questionSetTab() setting
editing: false. Present on v1.18.29 and current dev.

Plugins

No response

OpenCode version

1.18.29

Steps to reproduce

  1. Ask a question that produces multiple questions (tab bar with Confirm tab)
  2. Click "Type your own answer", type something
  3. Mouse-click the "Confirm" tab
  4. Press any key — nothing responds, Esc included

Screenshot and/or share link

No response

Operating System

Fedora 44 (Linux x86-64)

Terminal

Ghostty

Activity

  1. ishuowang commented on Sep 8, 2026

    @ishuowang

    I can take this. I’ll submit a minimal fix that resets the custom-answer editing state when switching question tabs, together with a focused regression test.

  2. ishuowang commented on Sep 8, 2026

    @ishuowang

    Preflight found the existing open PR #44240, which addresses the same selectTab / stale editing root cause. I won’t open a duplicate PR. I also have a focused local component regression test for the Confirm-tab keyboard trap and can offer it if the maintainers or the PR author would find it useful.

  3. resonanceee commented on Sep 24, 2026

    @resonanceee

    Hi, I have also faced the same bug. @ishuowang I checked the PR you mentioned and it appears to be closed due to automated cleanup, so no maintainer actually got to see it. If the PR owner will not reopen in a few days I will make a new PR myself.

  4. resonanceee commented on Oct 17, 2026

    @resonanceee

    v2 seems to fix this issue

  5. neriousy commented on Oct 20, 2026

    @neriousy
    Member

    Thanks for the report. Current v2 code clears custom-answer editing mode when switching question tabs, addressing the keyboard trap described here, so I'm closing this as resolved. If it returns on the latest v2, please open a new issue with your version and steps.

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