Skip to content

Fixed digit input routing into text field in choice menus - #105

Merged
oleg68 merged 1 commit into
nbplugins:mainfrom
oleg68:bugfix/choice-menu-text-input
May 4, 2026
Merged

oleg68 merged 1 commit into
nbplugins:mainfrom
oleg68:bugfix/choice-menu-text-input

Conversation

@oleg68

@oleg68 oleg68 commented May 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Fixed digits going into the "Type something." text field instead of selecting the intended numbered option in planning and permission-prompt choice menus — the controller now scans all options to find the text-input option and uses arrow-key navigation to reach the target option
  • Fixed "Yes, and tell Claude what to do next" option not showing a text input field in bash permission prompts — ScreenContentDetector now recognises the embedded , and tell Claude ... hint and sets hasTextInput=true

Implementation

  • ScreenContentDetector.extractOption: added AND_TELL_CLAUDE_PATTERN to split "Label, and tell Claude..." into display/description/hasTextInput=true
  • ClaudeSessionController.writePtyAnswer: added isTextInputOption() (checks hasTextInput OR display starts with "type") and findTextInputIdx() (scans all options); both the TYPE: and plain-digit branches now use arrow navigation when a text-input option is present
  • New test fixture: permission-prompt-bash for ScreenContentDetectorTest

Test plan

  • Build passes: mvn package
  • All 728 tests pass: mvn test
  • Planning menu: when "Type something." is the active PTY option, clicking a numbered option (e.g. "1") uses arrow navigation and does NOT type into the text field
  • Permission prompt (bash): "Yes, and tell Claude what to do next" shows a text input field in the UI
  • Permission prompt (bash): "Yes, and don't ask again for: ..." does NOT show a text input field

🤖 Generated with Claude Code

In planning and permission-prompt menus with a "Type something." or
"Yes, and tell Claude what to do next" option, Claude Code routes all
digit keystrokes to the text field regardless of which option the ❯
cursor is on. The plugin now detects any text-input option via
findTextInputIdx() and uses arrow-key navigation (ESC[A/ESC[B + Enter)
instead of sending the raw digit.

Also fixed: "Yes, and tell Claude what to do next" was not recognized as
a text-input option because its menu type lacks the shift+tab hint line.
Added AND_TELL_CLAUDE_PATTERN in ScreenContentDetector.extractOption() to
split such options into display="Yes" + description + hasTextInput=true.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@oleg68
oleg68 merged commit 4a5c8d2 into nbplugins:main May 4, 2026
3 checks passed
@oleg68
oleg68 deleted the bugfix/choice-menu-text-input branch May 4, 2026 06:44
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.

1 participant