Skip to content

[BUG] Fullscreen renderer (CLAUDE_CODE_NO_FLICKER=1) suspends with SIGTTIN on launch in iTerm2 3.6.1164; mouse tracking leaks into shell (works in Ghostty) #80131

Description

@nozikov

What's Wrong?

Summary: With the fullscreen renderer active (CLAUDE_CODE_NO_FLICKER=1), Claude Code loses the TTY foreground process group immediately after rendering the welcome banner and gets suspended by the shell with zsh: suspended (tty input) (SIGTTIN). Mouse tracking and terminal queries are not cleaned up, so after the suspend the shell is flooded with mouse-tracking escape reports (35;20;10M...) and the terminal's Primary Device Attributes response (>|iTerm2 3.6.1164;1;2;4;6;17;18;21;22;52c) leaks into the prompt.

The same failure occurs on the fullscreen-renderer promo prompt path: with settings.json removed entirely, Claude Code shows "Try the new fullscreen renderer?" and suspends at that prompt the same way. So both entry points into the fullscreen code path are affected.

The identical setup works perfectly in Ghostty. Only iTerm2 is affected.

Environment

  • Claude Code: 2.1.217 (native install), commit 9963b018d22c
  • Platform: darwin-arm64 (macOS, Apple Silicon)
  • Terminal: iTerm2 3.6.1164
  • Shell: zsh + starship prompt (no oh-my-zsh framework; cross-terminal .zshrc shared with Ghostty, where everything works)
  • Auth: Claude Max (claude.ai OAuth)
  • claude doctor: "No installation issues found"

Steps to Reproduce

  1. iTerm2 3.6.1164 on macOS (Apple Silicon), zsh.
  2. ~/.claude/settings.json containing "env": { "CLAUDE_CODE_NO_FLICKER": "1" }.
  3. Run claude in any directory (reproduces in project dirs and in /tmp).
  4. Welcome banner renders, then immediately: zsh: suspended (tty input) claude.
  5. Shell prompt returns with mouse tracking still enabled — moving the mouse spews 35;x;yM sequences; the DA response >|iTerm2 3.6.1164;...c appears at the prompt.

Variant B (promo prompt path):

  1. Remove/rename ~/.claude/settings.json.
  2. Run claude — the "Try the new fullscreen renderer?" prompt renders.
  3. Process suspends with zsh: suspended (tty input) at that prompt. Same escape-sequence leakage afterward.

What I ruled out

  • Project state: reproduces in /tmp with no project files. Largest per-session .jsonl files are ~14 MB (no oversized session files).
  • User settings/plugins: reproduces with ~/.claude/settings.json removed (variant B above).
  • The binary itself / global environment: the exact same binary, shell config, and settings work flawlessly in Ghostty — including the fullscreen renderer.

Expected Behavior

claude starts the interactive TUI in the foreground in iTerm2, as it does in Ghostty. If startup fails, terminal state (mouse tracking, alternate screen, pending queries) should be restored/consumed so escape sequences don't leak into the shell.

Workaround

Removing CLAUDE_CODE_NO_FLICKER and setting "tui": "default" in ~/.claude/settings.json avoids the fullscreen code path; Claude Code then starts normally in iTerm2. Alternatively, using Ghostty works with fullscreen enabled.

Notes

Possibly related to #11898 (CLI suspends / raw mode failures in iTerm2) — same SIGTTIN symptom, but here it is deterministically gated on the fullscreen renderer code path and is 100% reproducible on this setup.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:tuineeds-reproBug needs reproduction steps before we can investigate

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions