Skip to content

fix(claude-tmux): navigate modals with arrow keys so "Allow all edits" isn't downgraded to "Yes" - #37

Merged
alamops merged 1 commit into
mainfrom
agetor/7c28bc2a5209-fix-yes-allow-all-edits
Jun 2, 2026
Merged

fix(claude-tmux): navigate modals with arrow keys so "Allow all edits" isn't downgraded to "Yes"#37
alamops merged 1 commit into
mainfrom
agetor/7c28bc2a5209-fix-yes-allow-all-edits

Conversation

@alamops

@alamops alamops commented Jun 1, 2026

Copy link
Copy Markdown
Owner

Claude's REPL modal is rendered by Ink's select-input, which navigates with arrow keys and confirms with Enter — digit keypresses are silently dropped. The previous dismissal path sent the choice digit + Enter, so clicking option 2 ("Yes, allow all edits during this session") ended up confirming the default cursor on option 1 ("Yes"), making claude re-prompt on the next edit.

The scraper now records the cursor index alongside the choices, and dismissTmuxPrompt arrow-keys from that index to the target choice's index before sending Enter. This also fixes selection modals (model picker, /login) where the cursor opens on the current value rather than option 1.

  • thread cursorIndex through the scraper → registerTmuxPrompt → TmuxPromptRequest → server route → dismissTmuxPrompt
  • include cursor position in the scrape fingerprint so a mid-modal arrow re-registers with the new starting position
  • add explicit stillCurrent() re-gate before the final Enter
  • map target index via choices.findIndex(c => c.key === key) so leading- zero or non-digit keys can never silently mis-navigate
  • new scraper tests cover non-first cursor (model-picker shape) and fingerprint-changes-with-cursor

…" isn't downgraded to "Yes"

Claude's REPL modal is rendered by Ink's select-input, which navigates
with arrow keys and confirms with Enter — digit keypresses are silently
dropped. The previous dismissal path sent the choice digit + Enter, so
clicking option 2 ("Yes, allow all edits during this session") ended up
confirming the default cursor on option 1 ("Yes"), making claude
re-prompt on the next edit.

The scraper now records the cursor index alongside the choices, and
dismissTmuxPrompt arrow-keys from that index to the target choice's
index before sending Enter. This also fixes selection modals (model
picker, /login) where the cursor opens on the current value rather than
option 1.

- thread cursorIndex through the scraper → registerTmuxPrompt →
  TmuxPromptRequest → server route → dismissTmuxPrompt
- include cursor position in the scrape fingerprint so a mid-modal
  arrow re-registers with the new starting position
- add explicit stillCurrent() re-gate before the final Enter
- map target index via choices.findIndex(c => c.key === key) so leading-
  zero or non-digit keys can never silently mis-navigate
- new scraper tests cover non-first cursor (model-picker shape) and
  fingerprint-changes-with-cursor
@alamops alamops self-assigned this Jun 1, 2026
@alamops alamops added the bug Something isn't working label Jun 1, 2026
@alamops
alamops merged commit d9bcb6c into main Jun 2, 2026
alamops added a commit that referenced this pull request Jun 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant