[Bug] Agent view uses stale terminal width after window resize on Windows (ConPTY)

Status Open
Reported on v2.1.217
Maintainer reply None cached
Activity 5 comments · opened Jul 22, 2026

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

[]

View original on GitHub ↗

3 Comments

BadGasMileage · 2 months ago

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..

Cy-Toolio · 2 months ago

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=1 already set.

Symptoms:

  • Input box renders at a stale cached width. Typed text gets cut/wrapped incorrectly (e.g. "give me like a large amount of text on the screen" shows as just "the screen" on its own line).
  • Cursor draws in the wrong position, floating mid-line instead of at the actual text insertion point.
  • Status line (token count / mode indicator) renders misaligned relative to the input box border.
  • Click-drag text selection highlights the wrong lines relative to what's visually there.
  • Only fix: manually drag-resize the terminal window, which forces a real SIGWINCH and triggers a correct re-measure/redraw. Ctrl+L does not help.

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 2.1.232
  • Windows Terminal (Windows 11 Pro 10.0.26200)
  • PowerShell 7
  • CLAUDE_CODE_ALT_SCREEN_FULL_REPAINT=1 set
vcopleutre · 26 days ago

_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).

  • Claude Code 2.1.276
  • Windows 11 Pro 10.0.26200
  • Windows Terminal 1.24.11911.0
  • Windows PowerShell 5.1.26100.8972
  • settings.json: "tui": "fullscreen"

Showing cached comments. Read the full discussion on GitHub ↗