[FEATURE] Allow remapping cancellation from `esc` to something else

Resolved 💬 3 comments Opened Mar 1, 2026 by chriselrod Closed Mar 1, 2026

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

I absentmindedly tap esc all the time.
Accidental esc + Claude Code are not a good combo. I often type long responses to questions, and often don't switch to an editor.
Then suddenly, I lose everything -- the question and my answer are gone.
It had to happen a few times before I even realized I was hitting esc when it happened.
It's a habit to hit esc whenever I stop typing.

Definitely a "me" problem, but, it's often easier to configure a compute to work around me than change myself.

Proposed Solution

Allow rebinding the current functionality of esc to something else (and bind no action/ignore to the current esc key).

Ask "are you sure?" when canceling (and have this require a y/n input, and not accept additional esc to mean "yes") (e.g. #17505).

Alternative Solutions

I haven't tried any. Maybe some terminals allow disabling/remapping keys only for particular running programs.

Priority

Medium - Would be very helpful

Feature Category

CLI commands and flags

Use Case Example

_No response_

Additional Context

_No response_

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗