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

Resolved 💬 3 comments Opened Apr 8, 2026 by tcbennun Closed Apr 20, 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?

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 ↗

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