Allow rebinding or disabling double-escape (rewind) in keybindings.json
Problem
Double-pressing Escape opens the rewind/message selector dialog. This behavior is hardcoded and cannot be rebound or disabled through keybindings.json.
This is a significant pain point for terminal users who rely on Escape in their workflow — particularly those using bash/zsh vi-mode (set -o vi), where Escape is the primary key to enter normal/command mode.
Even after unbinding escape from chat:cancel in keybindings.json, the double-escape rewind trigger still intercepts Escape keypresses before they can reach the underlying terminal. This means vi-mode users cannot enter command mode at all while in the Claude Code chat input.
Current workaround
Remap vi-mode's escape to a key sequence like jk in .bashrc:
bind '"jk":vi-movement-mode'
This works, but it's a workaround that forces users to change their terminal habits to accommodate Claude Code, rather than Claude Code being configurable.
Proposed solution
Expose the double-escape rewind trigger as a rebindable action in keybindings.json, e.g.:
{
"context": "Chat",
"bindings": {
"escape escape": null,
"ctrl+k ctrl+r": "chat:rewind"
}
}
Additionally, Claude Code could detect vi-mode (set -o vi in bashrc/zshrc) and automatically adjust default keybindings to avoid conflicts — a built-in "vi mode" preset that respects the user's shell editing preferences out of the box.
Environment
- OS: Linux (WSL2)
- Terminal: WezTerm with CSI-u encoding
- Shell: bash with
set -o vi - Also affects: running Claude Code inside Neovim terminal (
:terminal), where<Esc><Esc>is mapped to exit terminal mode
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗