Ctrl-D to be removed from the end of session shortcut key
Status Fixed / completed
Maintainer reply ✓ Yes — wolffiex
Activity 12 comments · opened May 5, 2025 · closed May 7, 2025
💡 Likely answer: A maintainer (wolffiex, collaborator)
responded on this thread — see the highlighted reply below.
Ctrl-D's "Erase one character" shortcut is a standard text operation on macOS and is used frequently. If this is used to end the session, it will frequently cause unintended session terminations.
Since Ctrl-C is functionally available, I think there is no reason why Ctrl-D must have similar functions assigned.
12 Comments
Claude Code is for terminal users. Please revisit this change which makes cc unusable for anyone who has muscle memory for this common keyboard sequence. ctrl-d for erase char is standard and default for emacs users, who like myself chose cc over vscode alternatives. agree that the existing ctrl-c twice to exit is superior and did not need to be altered imo.
It's better because there's the --resume option, but if this operation causes a session to drop, I'll be insane.
+1 ... I have accidentally quit about a dozen sessions with
ctrl + d.According to Claude 3.7:
OK, I want to add one minor issue whihc fits to the context of this issue:
This is an amazing feature and I use it all the time, but when I remote connect to my temrinal with my ipad, I have the problem that there is no ESC ...
Can we have the option to map/overwrite some keys / shortcuts in a json config file? That would be great (or is this already available and I do not know?)
This one change has made Claude Code absolutely unusable. I am constantly exiting the program accidentally.
I'm using Claude Code in an Ubuntu terminal. Many of the lovely bash/emacs line edit commands work as expected except: Kablamo! CTRL-d quits and all my state is gone. Claude had an excellent suggestion when asked about this: "Train yourself to avoid Ctrl-D habit" . Yeah, right.
EDIT: Ok it redeemed itself when I pressed the point:
"You're absolutely right. For bash/emacs users, Ctrl-D is essential for daily editing (delete character forward) and its current implementation as EOF-only in Claude Code is inconsistent with the other line editing commands. This creates a frustrating experience when muscle memory kicks in.
This deserves a proper feature request - the CLI should either implement Ctrl-D for character deletion (matching standard terminal behavior) or provide a way to disable its EOF function."
Did something change recently? Within the last month, or more recently?
If this is correct:
The first (
ctrl+don an empty line) is fine, imo, and mirrors how many other macOS terminal programs work (e.g. python & ruby CLIs).But it seems like the second (
ctrl+din the middle of text) got broken sometime recently?If I press
ctrl+dtwice in the middle of text, it exits the session instead of just deleting.This is extremely frustrating since I lose whatever text was in progress. _And_ often I'll be in the middle of typing
ctrl+d_more_ than two times (or holding it down) so it will end up quitting claude code, exiting my terminal window, and then going on to exit other terminal windows!I'm experiencing this as a new problem just like other people. Similar to @jordan-brough, second
ctrl+dexits the session, and since I'm holding downctrl+d, Claude quits, then the terminal exits, then other terminal windows with important state start exiting, too.VERY frustrating, and it makes Claude Code dangerous to use.
This is supposed to work like iPython: ctrl+d deletes forward, for the special case where input is empty it quits
This regressed in v0.2.99
We should have the fix out tomorrow
This should be fixed in v 0.2.104
Thank you!!! So it seems I accidentally closed my last session officially yesterday.
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.