[Bug] Agent view uses stale terminal width after window resize on Windows (ConPTY)
Bug Description
Title: Agent view uses stale terminal width after window resize on Windows (ConPTY) — not fixed by Ctrl+L
Environment:
- OS: Windows 11
- Terminal: Windows Terminal
- Shell: PowerShell 7.6.4
- Claude Code: v2.1.217 (latest)
Description:
When the terminal window is resized during a session, the agent view (agent list ↔ agent detail) keeps rendering at the previous width, so text and the input-box border wrap at the old column count and the screen appears corrupted ("double" border lines, text wrapped as if the window were still its old size).
Steps to reproduce:
1. Start Windows Terminal at a small window size.
2. Launch claude.
3. Maximize the window.
4. Enter the agent view and go back and forth between the agent list and an agent's detail.
5. Text/borders wrap to the small (pre-maximize) width instead of the current maximized width.
The reverse also reproduces: start maximized, then shrink the window → content is laid out for the old larger width and overflows.
Key findings:
- Ctrl+L (repaint) does not fix it — it only redraws at the stale cached width without re-measuring the terminal.
- Only an actual resize event recovers it: dragging the window edge, or shrinking-then-re-maximizing. The maximize button / launch-maximized alone does not seem to deliver a resize the agent view picks up.
- This implies the agent view caches the terminal width and does not reflow when a resize event is missed or arrives late (appears specific to Windows/ConPTY resize-event delivery).
Impact: Any window resize mid-session leaves the agent view visually broken until a manual edge-drag resize is performed.
Not fixed by: updating to latest (v2.1.217), changing tui mode, or font/terminal changes.
Environment Info
- Platform: win32
- Terminal: xterm-256color
- Version: 2.1.217
- Feedback ID: 450a1e14-2ee2-40c4-8972-253546b4ce07
Errors
[]Showing cached comments. Read the full discussion on GitHub ↗
3 Comments
Same Issue described above. If you go back to small screen and drag the edges back to full screen it will render correctly again. Did for me anyway..
Still hitting this on Claude Code 2.1.232 (latest as of 2026-08-14), on Windows Terminal, with
CLAUDE_CODE_ALT_SCREEN_FULL_REPAINT=1already set.Symptoms:
This suggests full-repaint mode isn't sufficient on its own, since it just redraws at the same (wrong) cached width rather than re-querying actual terminal dimensions.
Environment:
CLAUDE_CODE_ALT_SCREEN_FULL_REPAINT=1set_Claude generated (obviously)_
Same issue here. Every time I switch to another agent in agent view, the drawing area shrinks while the window stays maximized, and typed input becomes invisible.
Resizing the window (Win+Down / Win+Up) fixes the current agent, but the problem comes back on the next switch, so the stale size seems to be re-applied on attach.
~/.claude/daemon/roster.json shows workers spawned with different sizes (155x42 to 209x51).