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 exit to 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, fg behavior can be inconsistent

This is a small quality-of-life fix that would eliminate a frequent source of frustration.

View original on GitHub ↗

6 Comments

swythan · 5 months ago

fg is also not available in Powershell (even on linux).

BlairStewart · 4 months ago

Whoever thought that implementing ctrl + z as suspend with no user preference setting to override really does not understand UX at all.

Pressing ctrl + z after 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 users ctrl + z means, undo the last thing you did.

Its ok to support these two user cases, but there should be some config to change the behavior.

github-actions[bot] · 3 months ago

Closing for now — inactive for too long. Please open a new issue if this is still relevant.

mschipperheyn · 3 months ago

This is still relevant. Reopen this please!

BlairStewart · 3 months ago

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 + z without 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.

Doorriiaann · 3 months ago

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

Showing cached comments. Read the full discussion on GitHub ↗