Ink focus-out re-render triggers iTerm2 activity indicator on tab switch

Open 💬 6 comments Opened Mar 2, 2026 by adiabatic

Bug

Switching away from a Claude Code tab in iTerm2 causes a spinner followed by a blue activity dot on the tab. This happens every time you switch tabs, making it look like Claude Code is doing work when it's idle.

Root cause

Claude Code's TUI framework (Ink) responds to terminal focus-in/focus-out escape sequences by re-rendering, which writes ANSI output to stdout. iTerm2 interprets any stdout activity on a background tab as "activity" and shows the blue dot indicator.

Reproduction

  1. Open Claude Code in an iTerm2 tab
  2. Switch to a different tab
  3. Observe the spinner, then blue dot on the Claude Code tab

Happens every time, regardless of whether Claude is actively working.

Diagnostic results

We isolated the cause by progressively disabling components:

| Test | Configuration | Blue dot? |
|------|--------------|-----------|
| Baseline | Everything enabled | Yes |
| No statusline | statusLine removed from settings | Yes |
| No statusline + no hooks | Both removed from settings | Yes |

With all user-configurable features disabled, the blue dot still appears, confirming it's internal to Claude Code's rendering layer.

Workaround

iTerm2 > Settings > Profiles > Terminal > uncheck "Show activity indicator"

This suppresses the symptom but is a blunt fix — it disables the indicator for all programs in that profile, not just Claude Code.

Suggested fix

Suppress Ink re-renders when the terminal reports focus-out (CSI I / CSI O sequences), or avoid writing to stdout in response to focus change events when there's no actual state change to render.

Environment

  • macOS (Darwin 25.3.0)
  • iTerm2
  • Claude Code (latest as of 2026-03-02)

View original on GitHub ↗

This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗