[BUG] Cannot undo (`chat:undo`) in iTerm2 with Ctrl+_

Status Fixed / completed
Reported on v2.0.76
Maintainer reply ✓ Yes — claude[bot]
Activity 3 comments · opened Apr 8, 2026 · closed Apr 20, 2026
💡 Likely answer: A maintainer (claude[bot], contributor) responded on this thread — see the highlighted reply below.

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?

I'm using iTerm2 3.6.9 on macOS 26.4 (Apple M1 Max).

In the chat, pressing Ctrl+_ (or equivalently Ctrl+Shift+-) does not perform an undo.

Explicitly binding chat:undo to these sequences in keybindings.json does not help.

This bug manifests whether the editor is set to vim or normal mode.

Other bindings to chat:undo work fine.

Snippet from my keybindings.json (note "ctrl+shift+x", an example of a working bind):

{
  "$schema": "https://www.schemastore.org/claude-code-keybindings.json",
  "$docs": "https://code.claude.com/docs/en/keybindings",
  "bindings": [
    // ...
    {
      "context": "Chat",
      "bindings": {
        // ...
        "ctrl+_": "chat:undo",
        "ctrl+shift+-": "chat:undo",
        "ctrl+shift+x": "chat:undo",
        // ...
      }
    },
    // ...
  ]
}

What Should Happen?

The default key sequences bound to chat:undo should perform an undo in the chat when pressed.

Error Messages/Logs

No relevant warnings or errors from the logs when running `claude --debug`. Relevant log lines:

2026-04-08T12:26:34.350Z [DEBUG] [keybindings] Loaded 116 user bindings from /Users/tcb/.claude/keybindings.json
2026-04-08T12:26:34.352Z [DEBUG] [keybindings] KeybindingSetup initialized with 237 bindings, 0 warnings

Steps to Reproduce

  1. Delete user-local keybindings.json or replace with minimal contents:
{
  "$schema": "https://www.schemastore.org/claude-code-keybindings.json",
  "$docs": "https://code.claude.com/docs/en/keybindings",
  "bindings": [
    {
      "context": "Chat",
      "bindings": {
        "ctrl+_": "chat:undo",
        "ctrl+shift+-": "chat:undo"
      }
    }
  ]
}
  1. Launch iTerm2 and run claude
  2. Type "hello world" and press Ctrl+_
  3. No change to text in chat editor

Claude Model

Not sure / Multiple models

Is this a regression?

Yes, this worked in a previous version

Last Working Version

2.0.76

Claude Code Version

2.1.96

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

iTerm2

Additional Information

Running cat | xxd and hitting Ctrl+_ echoes ^_ as expected.

The most recent version of Claude I can find where this bug does not occur is 2.0.76.

View original on GitHub ↗

3 Comments

github-actions[bot] · 6 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/44757
  2. https://github.com/anthropics/claude-code/issues/38807
  3. https://github.com/anthropics/claude-code/issues/39769

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

claude[bot] contributor · 5 months ago

This issue was fixed as of version 2.1.116.

github-actions[bot] · 5 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.