Ctrl-D unexpectedly terminates session instead of deleting characters in macOS
# Ctrl-D unexpectedly terminates session instead of deleting characters in macOS
## Description
When using Claude Code CLI on macOS, pressing Ctrl-D unexpectedly terminates the entire session instead of deleting characters forward as it normally would in standard macOS terminals.
## Expected Behavior
Ctrl-D should delete the character at the cursor position (forward delete), matching standard macOS terminal behavior.
## Current Behavior
Pressing Ctrl-D immediately terminates the Claude Code session, causing loss of context and requiring restart.
## Environment Information
- OS: macOS 15.4.1 (Sequoia)
- Terminal: xterm-256color (Node.js based terminal emulator)
- Claude Code version: 0.2.107 (Claude Code)
- Shell: zsh
## Additional Information
This behavior is disruptive to the normal workflow as many macOS users rely on Ctrl-D for forward deletion. The termination happens without warning or confirmation, potentially causing loss
of work.
## Steps to Reproduce
- Start Claude Code CLI with
claudecommand - Begin typing a prompt
- Position cursor within the text
- Press Ctrl-D
- Observe that the session terminates instead of deleting a character
11 Comments
This seems to be a regression from the fix applied in #960. It also impacts
platform:linuxThis issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
I have just encountered this several times today.
Claude Code v2.0.65
MacOS 14.5
Iterm2
Me too
Can confirm there is a regression here recently.
I have encountered this
ClaudeCode: Version: 2.0.76
MacOS: 26.2
Terminal: iTerm2 + tmux
FYI: workaround only for nvim plugin example
Use: claudecode nvim plugin https://github.com/coder/claudecode.nvim
Settings:
I disabled
Ctrl-Dwhile focusing on claude code buffer.Here is the setting example.
This happens to me all day long. This happens on linux too. But the description is slightly incorrect in that the 1st Ctrl-D does delete 1 char, it's the 2nd Ctrl-D that terminates claude. It shouldn't terminate claude until/unless the input buffer is empty - same as in bash shell.
In my environment(Claude Code v2.1.22), this issue has been fixed. Please check the behavior:
Ctrl + Ddeletes characters.Ctrl + Dshows message "Press Ctrl-D again to exit". Pressing again exits claude code.Closing for now — inactive for too long. Please open a new issue if this is still relevant.
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.