Forumics logo Forumics
Issue 01

Back to issue

All Zed known issues

CLAIM C251 Supported 2026-12-06

GitHub issue #52128 in zed-industries/zed, created 2026-03-22 by ShlackBaum and titled "Claude Code (and likely other long-running CLI tools) freezes in unfocused Zed terminal", reports that Claude Code (a CLI agent running in Zed's integrated terminal) stops making progress when its terminal tab/window is not focused, and resumes immediately when the user clicks back on the terminal, while background bash processes started with `nohup` continue running fine — only the PTY-dependent process freezes. In a controlled experiment with 3 agents writing to separate log files, each running a `nohup` background heartbeat every 5 seconds and 30 sequential tool calls, the focused terminal completed all 30 tool calls in about 5 minutes with no gaps, while the unfocused terminal froze after tool call 1 for 5 minutes 14 seconds and then resumed normally; the `nohup` heartbeat had zero gaps during the entire freeze. The author hypothesises that when a terminal tab loses focus, Zed stops (or heavily throttles) reading from the PTY output buffer, so when the buffer fills up the child process's `write()` to stdout blocks, which blocks the Node.js event loop of Claude Code. The expected behaviour is that Zed keeps reading PTY output from unfocused terminals, even if rendering is throttled or skipped.

Verbatim Excerpts from Cited Records
“Claude Code (CLI agent running in Zed's integrated terminal) stops making progress when its terminal tab/window is not focused. The process resumes immediately when the user clicks back on the terminal. Background bash processes (via `nohup`) continue running fine — only the PTY-dependent process freezes.”
— ShlackBaum · zed-industries/zed (issue 52128 opening body, Summary section) · 2026-03-22T12:14:33Z ·GitHub Issue ↗
“**Agent 2** (unfocused terminal): **Froze after tool call 1 for 5 minutes 14 seconds**, then resumed normally:”
— ShlackBaum · zed-industries/zed (issue 52128 opening body, Diagnostic Data / Results section) · 2026-03-22T12:14:33Z ·GitHub Issue ↗
“**Key observation**: The `nohup` heartbeat (writing directly to a file, not through PTY) had **zero gaps** during the entire freeze. Every 5 seconds, perfectly consistent.”
— ShlackBaum · zed-industries/zed (issue 52128 opening body, Diagnostic Data / Key observation section) · 2026-03-22T12:14:33Z ·GitHub Issue ↗
“Zed should continue reading PTY output from unfocused terminals. Rendering can be throttled/skipped, but the PTY buffer must be drained to avoid blocking child processes.”
— ShlackBaum · zed-industries/zed (issue 52128 opening body, Expected Behavior section) · 2026-03-22T12:14:33Z ·GitHub Issue ↗
Counter-record: 10 comments read in total. The author posted 4 updates (2026-03-23/24): workarounds tested, a node-pty proxy workaround with non-blocking stdout, a correction that the tmux workaround may have failed only because the shell was not restarted after install, and a cautionary note about a monitoring-hook incident. Independent confirmations: videni (2026-03-25, "get stuck every few hours") and Unmask06 (2026-04-02, "Especially claude code, even single minute"). github-actions[bot] closed the issue 2026-08-28 due to inactivity; udtaichung (2026-09-19) reported it still reproducible on Zed 1.18.0 stable (Windows 10) with a control-group comparison against Tabby, and the issue is open again as of 2026-12-05. udtaichung also adds a refinement that partly counters the opening hypothesis: a bare bash loop printing 8 KB every 2 s in an unfocused Zed terminal did not stall, so Zed does not simply stop draining the PTY for every unfocused terminal — something specific to Claude Code's TUI output triggers it. No fix, no maintainer comment and no withdrawal in the thread. Falsification probe: If issue #52128 is closed as fixed, as a duplicate, or as not planned, or if the author edits the opening body so the quoted sentences no longer match verbatim, this claim drops to Withdrawn. Audit verification: Verified 100% continuous verbatim substring against official GitHub REST API by scripts/verify_claim_verbatim.py.