[BUG] Ctrl-Z (SIGTSTP) no longer backgrounds Claude Code in 2.1.1 (confirmed in iTerm2 and Ghostty)
Status Fixed / completed
Reported on v2.1.1
Maintainer reply ✓ Yes — ashwin-ant
Workaround ✓ Mentioned in thread ↓
Activity 14 comments · opened Jan 7, 2026 · closed Apr 18, 2026
💡 Likely answer: A maintainer (ashwin-ant, collaborator)
responded on this thread — see the highlighted reply below.
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Potentially related to, but not the same as, https://github.com/anthropics/claude-code/issues/16520
Description:
After upgrading to Claude Code 2.1.0/2.1.1, Ctrl-Z no longer suspends/backgrounds the process. This worked in 2.0.76.
Environment:
- Claude Code 2.1.1
- macOS (Darwin 25.1.0)
- Multiple terminal emulators affected
Notes:
- Ctrl-Z works correctly with other processes (e.g., tail -f)
- Issue affects all Claude instances, including fresh terminals
- Terminal settings are correct (stty susp = ^Z)
- Seems to still work in native Terminal. Does not work in iTerm or Ghostty.
What Should Happen?
Expected: Process suspends and returns to shell prompt
Actual: Nothing happens
Error Messages/Logs
Steps to Reproduce
- Start claude in iTerm2 or Ghostty
- Press Ctrl-Z
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
2.0.76
Claude Code Version
2.1.1 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
iTerm2
Additional Information
_No response_
14 Comments
I just tried it on wezterm / wezterm mux on Linux and Alcritty/WSL. Maybe it's specific to MacOS?
You can try the following command and let me know if it works properly.
env -u TERM_PROGRAM -u TERM_PROGRAM_VERSION TERM=xterm-256color claudeClaude Code detects Ghostty (TERM=xterm-ghostty / TERM_PROGRAM=ghostty) and, when entering raw mode, writes ESC[>1u to enable the Kitty keyboard protocol. Ghostty then encodes many Ctrl+<key> combinations as CSI … u sequences instead of classic single-byte control codes (e.g. ^C = 0x03). Claude Code/Ink still checks for "\x03" / other legacy control bytes (and/or doesn’t properly map CSI u back to ctrl key events), so all Ctrl shortcuts become no-ops in Ghostty. Hiding Ghostty identity (env -u TERM_PROGRAM -u TERM_PROGRAM_VERSION TERM=xterm-256color claude) prevents enabling ESC[>1u and restores normal Ctrl behavior.
@bcherny
Same issue on iterm2 on mac os x, env -u TERM_PROGRAM -u TERM_PROGRAM_VERSION TERM=xterm-256color does help.
I was using it inside nvim internal terminal split and it was driving me insane. It was working perfectly. Then it suddenly stopped (and
ctrl + [as escape stopped as well as usual escape reserved for nvim normal mode). Being nvim user I was suspecting something went wrong in my local setup. I was checking everything. Also on remote ssh session on Ubuntu it kinda kept working.Yeah confirmed for me on iTerm2 -- I unset
TERM_PROGRAM(TERM is already defined asxterm-256color.. I don't remember setting it myself so I suspect it's a mac/iTerm default) and now ctrl+z works as expected.yep same for me but works with the above workaround.
As mentioned in https://github.com/anthropics/claude-code/issues/16895#issuecomment-3727205302, this can be worked around in Ghostty with the following config:
Confirming this also affects Ghostty on Linux (Fedora 43, Ghostty 1.2.3).
The
keybind = ctrl+z=text:\x1aGhostty workaround from @sambostock works here too.In fact, I’ve noticed a phenomenon:
The latest nightly build of Ghostty is working. https://github.com/ghostty-org/ghostty/releases
this helps
Any plans to fix this? Pretty major regression for those of us who frequently switch between claude and vim, etc
Also, can confirm adding this alias to my .zshrc worked
alias cc='env -u TERM_PROGRAM -u TERM_PROGRAM_VERSION TERM=xterm-256color claude'env -u TERM_PROGRAM -u TERM_PROGRAM_VERSION TERM=xterm-256color claudedidn't worked for me, using iterm2This was fixed in v2.1.9 — Ctrl+Z now correctly suspends Claude Code in terminals using the Kitty keyboard protocol (iTerm2, Ghostty, etc.). If you're still seeing this in the latest version, please comment with your version and repro and we'll reopen.
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.