Windows Terminal rendering broken after /statusline - scroll margins not reset
Resolved 💬 5 comments Opened Dec 19, 2025 by StevenD27 Closed Feb 14, 2026
Bug Report: Windows Terminal Rendering Issues After /statusline
Environment
- OS: Windows 11 (MSYS_NT-10.0-26200)
- Terminal: Windows Terminal / PowerShell
- Claude Code Version: v2.0.73
- Model: Opus 4.5
Summary
After running /statusline command, terminal rendering is broken in PowerShell/Windows Terminal. Content is missing, truncated, or overwritten. The issue does NOT occur in CMD.
Symptoms
Symptom 1: Last line of output hidden
- When displaying 10 lines of text, line 10 is not visible
- Works correctly in CMD
- Caused by DECSTBM scroll margins not being reset
Symptom 2: Content in middle of output missing
- Insight sections partially rendered
- Lines appear truncated on the left side
- Content appears fragmented (e.g., "before the next batch." floating without context)
Symptom 3: Lines 1-9 hidden, only line 10 visible
- Asked for 10-line output
- Only the last line rendered
- Previous lines completely missing
Root Cause Analysis
- Scroll Margins (DECSTBM): The
/statuslinefeature usesESC[<top>;<bottom>rto reserve the bottom line. These margins are NOT properly reset when statusline fails or is disabled on Windows Terminal.
- Cursor Manipulation: Claude Code uses ANSI escape codes (
\033[Fmove up,\033[Kclear line) that overwrite previous content on Windows.
- ConPTY Differences: Windows Terminal uses ConPTY which maintains ANSI state (including scroll margins), while CMD's legacy console often resets them.
Reproduction Steps
- Start Claude Code in Windows Terminal (PowerShell)
- Run
/statusline - Exit or disable statusline
- Ask Claude to output 10 lines of text
- Observe: last line (or multiple lines) are hidden
Partial Workaround Found
Resetting scroll margins with:
[Console]::Write([char]27 + "[r")
This fixes the "last line hidden" symptom but does NOT fix the content overwriting/truncation issues.
Related Issues
- #4897 - Console output overwritten on Windows (CRITICAL)
- #8618 - CLI Terminal UI Rendering Corrupted (SHOW-STOPPER)
- #14125 - StatusLine not rendering in Windows Terminal
- #6526 - StatusLine not displaying on Windows 11
Expected Behavior
- All output lines should be visible
- Content should not be truncated or overwritten
/statuslineshould properly clean up terminal state when disabled
Suggested Fix
- Reset scroll margins (
ESC[r) when statusline is disabled - Consider disabling cursor manipulation ANSI codes on Windows
- Test terminal state cleanup on Windows Terminal specifically
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗