Ctrl+Z suspends CLI — should be intercepted or remapped
Status Closed — not planned
Maintainer reply None cached
Activity 7 comments · opened Apr 4, 2026 · closed Jun 20, 2026
Problem
Ctrl+Z sends SIGTSTP and suspends the Claude Code process. This is almost never intentional — users hit it expecting "undo" (the universal shortcut in every other application). Instead, the entire session freezes and drops to the shell with no warning.
Expected behavior
Ctrl+Z should be intercepted by the CLI and either:
- Ignored (with a brief flash message like "use
exitto leave") - Mapped to undo (undo last input character / line, consistent with every other text input on earth)
Why this matters
- Muscle memory makes this extremely common
- Recovering a suspended session (
fg) isn't obvious to many users - Mid-conversation suspends can cause confusion about session state
- On mobile terminals / tmux,
fgbehavior can be inconsistent
This is a small quality-of-life fix that would eliminate a frequent source of frustration.
Showing cached comments. Read the full discussion on GitHub ↗
6 Comments
fgis also not available in Powershell (even on linux).Whoever thought that implementing
ctrl + zas suspend with no user preference setting to override really does not understand UX at all.Pressing
ctrl + zafter accidentally pasting something and having claude code suspend was literally the first time I have ever heard of this control code, and I have been using CLI for 20+ years. I am sure that some people use it often in their flow, but I would bet for the VAST majority of usersctrl + zmeans, undo the last thing you did.Its ok to support these two user cases, but there should be some config to change the behavior.
Closing for now — inactive for too long. Please open a new issue if this is still relevant.
This is still relevant. Reopen this please!
Yup this is still an issue. Even though I know that this is a thing. I STILL accidentally trash what I was writing when I mash
CTRL + zwithout even thinking. Its so ingrained in my reactions when I make a mistake. This is extra bad when I have spent some time crafting the exact prompt that I need. And now its gone and I have to start again.This needs fixing! I wasted a ton of tokens in a long subagent heavy flow that now just voided my entire work. I cannot believe this is just being closed