[BUG] AskUserQuestion: ESC cancels the tool call, collides with vim-style normal-mode navigation

Resolved 💬 1 comment Opened May 27, 2026 by santhoshsram Closed Jun 27, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

### Environment

  • Claude Code CLI (terminal)
  • macOS (Darwin 25.5.0)
  • Model: Opus 4.7

### Summary
Pressing ESC while interacting with an AskUserQuestion prompt cancels the tool call (treated as "user rejected tool use"). This collides with
the muscle-memory ESC used to enter vim normal mode for editing the input field, causing accidental cancellations.

### Repro

  1. Claude invokes AskUserQuestion with multiple options.
  2. While the question UI is focused, press ESC (e.g. to switch to vim normal mode so you can navigate back and edit your input, or just out of

habit if you use vim keybindings elsewhere).

  1. The tool call is cancelled with "The user doesn't want to proceed with this tool use."

### Expected
ESC should either:

  • Be scoped to input-field behavior (e.g. exit insert mode without cancelling the tool), or
  • Require a confirmation / a different key (e.g. Ctrl+C) to cancel the tool call, or
  • Be configurable.

### Actual
ESC immediately cancels, discarding all in-progress answers. The user then has to ask Claude to re-issue the same question, which costs a
round-trip and re-renders the (sometimes long) option set.

### Impact

  • Frequent for users with vim keybindings as muscle memory.
  • High-friction in interactive planning sessions where AskUserQuestion is used across multiple rounds — one accidental ESC discards the current

batch of answers.

  • Encourages users to avoid the tool, which is otherwise the cleanest way to gather structured input.

What Should Happen?

### Suggested fix
Either remap cancel to a less-collision-prone key (Ctrl+C, or a double-ESC confirmation) or treat ESC as a no-op when focus is in the answer
input.

Error Messages/Logs

Steps to Reproduce

### Repro

  1. Claude invokes AskUserQuestion with multiple options.
  2. While the question UI is focused, press ESC (e.g. to switch to vim normal mode so you can navigate back and edit your input, or just out of

habit if you use vim keybindings elsewhere).

  1. The tool call is cancelled with "The user doesn't want to proceed with this tool use."

Claude Model

Opus

Is this a regression?

No, this never worked

Last Working Version

_No response_

Claude Code Version

2.1.152

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Other

Additional Information

Using Claude Code in ghostty terminal emula

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗