Skip to content

fix(tui): stop left/right arrow propagation in permission and questio…#1548

Open
Gaobo-Hp1 wants to merge 1 commit into
XiaomiMiMo:mainfrom
Gaobo-Hp1:fix/left-right-arrow-event-propagation
Open

fix(tui): stop left/right arrow propagation in permission and questio…#1548
Gaobo-Hp1 wants to merge 1 commit into
XiaomiMiMo:mainfrom
Gaobo-Hp1:fix/left-right-arrow-event-propagation

Conversation

@Gaobo-Hp1

@Gaobo-Hp1 Gaobo-Hp1 commented Jul 3, 2026

Copy link
Copy Markdown
  • Add evt.stopPropagation() to left/right key handlers in PermissionPrompt
  • Add evt.stopPropagation() to left/right key handlers in QuestionPrompt
  • Prevents arrow key events from propagating to CommandProvider which would trigger unintended subAgent navigation via session_child_cycle

Issue for this PR

Closes #1547 1547

Type of change

  • [√ ] Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?
When a permission prompt or question prompt is shown, pressing left/right arrow keys to switch options triggers subAgent navigation instead, because CommandProvider's global useKeyboard handler matches session_child_cycle/session_child_cycle_reverse (bound to bare left/right) before the prompt's own handler runs.
These prompts are rendered inline inside the session component, not via the Dialog system, so CommandProvider's dialog.stack.length > 0 guard doesn't skip them.
Fix: add evt.stopPropagation() in both prompts' left/right key handlers to prevent the event from reaching CommandProvider.

How did you verify your code works?

  • Ran bun typecheck — passes (12/12 packages)
  • Test infra has pre-existing failures (timeouts on LLM integration tests) unrelated to this change
  • Built binary: mimo --version outputs 0.0.0-fix/...

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Maybe upgrade the opencode version can fix this problem, opencode use keymapping.

…n prompts

- Add evt.stopPropagation() to left/right key handlers in PermissionPrompt
- Add evt.stopPropagation() to left/right key handlers in QuestionPrompt
- Prevents arrow key events from propagating to CommandProvider which
  would trigger unintended subAgent navigation via session_child_cycle
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.

左右方向键会进入subagent

1 participant