[BUG] TUI repaints only the status bar in a loop when tmux reports a 1-row window height
Summary
Under tmux, the TUI got stuck repainting only the bottom status bar roughly once per second, indefinitely, while the session was otherwise alive and working. At the time tmux reported the window as 145x1 (one row tall), even though the physical terminal was about a quarter of a large screen — i.e. a perfectly usable size, not a genuinely 1-row terminal.
So there appear to be two things: a bogus size being reported/applied (likely a SIGWINCH race on attach with multiple clients), and — the part that matters for Claude Code — the TUI busy-repainting instead of degrading gracefully or re-querying the terminal size when the reported height is degenerate.
Environment
- Claude Code 2.1.220
- tmux 3.4,
TERM=tmux-256color,window-size latest(default),status-interval 15 - Linux 6.17 (Ubuntu), attached over SSH
- Multiple tmux sessions running Claude Code, several clients attached at differing sizes (e.g. 72x38 and 85x23 on the same session)
What I observed
tmux list-windows -a while the session was stuck:
claude:0 145x44
claude2:0 25x22
claude3:0 145x1 <-- the stuck session
The pane content was just the mode/status line being redrawn; the agent itself was still fine (a tool call was in flight and completed). After manually resizing the terminal, the window picked up a normal size and rendering recovered immediately.
Note claude2:0 at 25x22 as well — very narrow — which suggests sizes were being negotiated oddly across clients generally, not just once.
Expected
At a degenerate reported size (height 0/1, or width below the minimum the UI needs), the TUI should render a minimal static frame or a "terminal too small" notice and stop repainting, rather than looping. Re-querying the size on repeated failed layouts would also recover it without user intervention.
Repro
I don't have a deterministic repro. The conditions present were: multiple tmux clients attached to sessions at different sizes with window-size latest, over SSH, with attach/detach happening while Claude Code was mid-turn. Resizing the terminal, or tmux set -g window-size largest, avoids it.