Skip to content

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

Description

@Adolys

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

[]

Activity

  1. BadGasMileage commented on Jul 29, 2026

    @BadGasMileage

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

  2. Cy-Toolio commented on Aug 14, 2026

    @Cy-Toolio

    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
  3. added
    area:agent-viewclaude agents TUI / --bg / FleetView / daemon bg sessions
    on Aug 26, 2026
  4. self-assigned this
    on Aug 29, 2026
  5. vcopleutre commented on Sep 18, 2026

    @vcopleutre

    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"
  6. Elewyth commented on Oct 6, 2026

    @Elewyth

    Still happening on Claude Code 2.1.286, Windows 11 Pro 10.0.26200, Windows Terminal 1.24.11911.0, PowerShell, fullscreen renderer.

    Symptoms after resizing the window and switching between agents in agent view:

    • the input cursor is drawn in the wrong place
    • typed text shows up in the status line instead of the input box
    • Ctrl+L doesn't fix it
    • any real window resize fixes it right away (even a few pixels, or Win+Down / Win+Up)

    ~/.claude/daemon/roster.json shows my workers were spawned at two different sizes, matching the window size when each session started:

    workers dispatch cols x rows
    4 209 x 58
    2 187 x 70

    So it looks like the size from spawn time comes back when I attach to a worker, and nothing corrects it until the next real resize.

  7. DivBuild commented on Oct 8, 2026

    @DivBuild

    Also seeing this on Claude Code 2.1.295, Windows 11 (10.0.26300), Windows Terminal 1.24.12741.0, Windows PowerShell 5.1. Rows overlap and stale text stays in agent view until a real resize; Ctrl+L doesn't help. Reproduces with compatibility.textMeasurement set to both graphemes and wcswidth. ~/.claude/daemon/roster.json shows workers spawned at mixed sizes (120×30, 143×48, 145, 154, 209 cols), consistent with the stale-geometry-on-attach theory above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:agent-viewclaude agents TUI / --bg / FleetView / daemon bg sessionsarea:tui

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions