claude-code - 💡(How to fix) Fix [BUG] Cannot undo (`chat:undo`) in iTerm2 with Ctrl+_ [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#45198Fetched 2026-04-09 08:10:59
View on GitHub
Comments
1
Participants
2
Timeline
7
Reactions
0
Author
Timeline (top)
labeled ×6commented ×1

Error Message

Error Messages/Logs

Code Example

{
  "$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",
        // ...
      }
    },
    // ...
  ]
}

---

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

---

{
  "$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"
      }
    }
  ]
}
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • 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.

extent analysis

TL;DR

The issue can likely be resolved by downgrading to Claude Code version 2.0.76, where the bug does not occur.

Guidance

  • Verify that the issue persists when using the default keybindings without any custom configurations in keybindings.json.
  • Check if other keybindings that use Ctrl+Shift combinations work as expected to isolate the issue.
  • Test the Ctrl+_ and Ctrl+Shift+- key combinations in other contexts or applications to ensure they are functioning correctly.
  • Consider reporting this issue to the Claude Code developers, as it appears to be a regression introduced in version 2.1.96.

Example

No code snippet is provided, as the issue seems to be related to a specific version of Claude Code rather than a code-related problem.

Notes

The issue may be specific to the combination of Claude Code version 2.1.96, iTerm2 3.6.9, and macOS 26.4 (Apple M1 Max), so testing on different environments may yield different results.

Recommendation

Apply workaround: Downgrade to version 2.0.76, as it is confirmed to work correctly. This is recommended because the issue is identified as a regression and downgrading to a previous version where the feature worked is a reliable temporary solution until the issue is fixed in a newer version.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING