[BUG] chat:undo (ctrl+_/ctrl+-) exits Claude Code and closes terminal

Resolved 💬 4 comments Opened Feb 16, 2026 by tholbrook9 Closed Mar 20, 2026

Environment

  • Platform: Anthropic API
  • Claude CLI version: 2.1.42
  • Operating System: Linux 6.12 (Debian), GNOME/Wayland
  • Terminal: Ghostty 1.1.3

Bug Description

Pressing ctrl+- while in Claude Code's chat input causes Claude Code to exit entirely, which closes the terminal window. On most terminals, ctrl+- produces the same character as ctrl+_ (ASCII 0x1F), which is bound to chat:undo by default.

The expected behavior of chat:undo is to rewind the conversation. Instead, it appears to exit the Claude Code process, causing the terminal to close.

This does not happen in a plain shell — ctrl+- correctly triggers Ghostty's decrease_font_size binding. It only occurs when Claude Code is running and intercepts the keypress.

Steps to Reproduce

  1. Open Ghostty (or any terminal where ctrl+- sends ctrl+_)
  2. Start Claude Code (claude)
  3. Press ctrl+- while in the chat input
  4. Claude Code exits and the terminal window closes

Expected Behavior

chat:undo should rewind the conversation, or do nothing if there's nothing to undo. It should never exit the process.

Actual Behavior

Claude Code exits, closing the terminal window. No crash — clean exit (no core dump).

Workaround

Unbind ctrl+_ in ~/.claude/keybindings.json:

{
  "bindings": [
    {
      "context": "Chat",
      "bindings": {
        "ctrl+_": null
      }
    }
  ]
}

View original on GitHub ↗

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