[BUG] chat:undo (ctrl+_/ctrl+-) exits Claude Code and closes terminal
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
- Open Ghostty (or any terminal where
ctrl+-sendsctrl+_) - Start Claude Code (
claude) - Press
ctrl+-while in the chat input - 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
}
}
]
}This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗