claude agents: entering a task intermittently shrinks the terminal window by ~1 row + 1 col (off-by-one resize, v2.1.178, Windows Terminal)
What happened
On Windows Terminal, entering a task in the claude agents (FleetView) view physically resizes the terminal window — not just re-wrapping content — making it ~1 row shorter and ~1 column narrower. It happens intermittently (frequently, but not every time), and it compounds: when it triggers, the window loses another row/col. Because Windows' window-resize path leaves display artifacts, the UI is corrupted until the window is manually reset to its original size.
Environment
- Claude Code v2.1.178 (regression — v2.1.177 and earlier did not do this; the behavior started with 2.1.178)
- Windows 11, Windows Terminal, Command Prompt profile
- Triggered by entering a task from the
claude agents/ FleetView view
Why this is an actual window resize (not a stale re-render)
Windows Terminal honors the XTWINOPS resize-window sequence CSI 8 ; rows ; cols t; legacy conhost ignores it. The window physically shrinking — rather than content merely re-wrapping at the wrong width — points to Claude Code emitting that sequence.
The ~1-row/1-col shrink, combined with the intermittency, suggests a race in measuring the terminal dimensions rather than a static off-by-one: CC appears to read stdout.columns/stdout.rows at a moment when the reported size is transiently off (e.g. mid-redraw or during an alt-screen transition), then echoes that size back via CSI 8t. When the read lands on a stable frame, nothing happens; when it races the transition, the window shrinks by one cell. Repeated triggers compound the shrink.
Likely regression source
The v2.1.178 changelog entry "Fixed claude agents: pressing back in one window no longer detaches other windows" is the only sizing-adjacent change in v2.1.175–178. The multi-window state handling it touches is a plausible origin for an emitted resize.
Related but distinct
- #58555 — FleetView re-renders at stale/narrow cached dimensions. That is content re-wrap, not a physical window resize. This report is a different failure mode (the OS window dimensions actually change).
Repro
- Open Windows Terminal (Command Prompt profile) and launch
claude agents - Enter a task in the FleetView view
- Observe the window intermittently shrink by ~1 row + 1 col; repeat — when it triggers it compounds, and display artifacts persist until the window is manually resized back
Diagnostic suggestion
Running the same flow in a plain conhost window (which ignores CSI 8t) should not resize the window — confirming the cause is an emitted escape sequence racing the redraw rather than a direct SetConsoleWindowInfo Win32 call.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗