[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
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

  1. Start claude in iTerm2 or Ghostty
  2. 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_

View original on GitHub ↗

14 Comments

tobert · 7 months ago

I just tried it on wezterm / wezterm mux on Linux and Alcritty/WSL. Maybe it's specific to MacOS?

Haleclipse · 7 months ago

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 claude

Haleclipse · 7 months ago

Claude 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

kuddai · 7 months ago

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.

steinnes · 7 months ago

Yeah confirmed for me on iTerm2 -- I unset TERM_PROGRAM (TERM is already defined as xterm-256color .. I don't remember setting it myself so I suspect it's a mac/iTerm default) and now ctrl+z works as expected.

brtkwr · 7 months ago

yep same for me but works with the above workaround.

sambostock · 7 months ago

As mentioned in https://github.com/anthropics/claude-code/issues/16895#issuecomment-3727205302, this can be worked around in Ghostty with the following config:

keybind = ctrl+z=text:\x1a
colinbrophy-genius · 7 months ago

Confirming this also affects Ghostty on Linux (Fedora 43, Ghostty 1.2.3).

The keybind = ctrl+z=text:\x1a Ghostty workaround from @sambostock works here too.

Haleclipse · 7 months ago
Confirming this also affects Ghostty on Linux (Fedora 43, Ghostty 1.2.3). The keybind = ctrl+z=text:\x1a Ghostty 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

mjaric · 7 months ago
env -u TERM_PROGRAM -u TERM_PROGRAM_VERSION TERM=xterm-256color claude

this helps

ethanfischer · 7 months ago

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'

avinashvrm · 4 months ago

env -u TERM_PROGRAM -u TERM_PROGRAM_VERSION TERM=xterm-256color claude didn't worked for me, using iterm2

ashwin-ant collaborator · 4 months ago

This 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.

github-actions[bot] · 4 months ago

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.