[BUG] Agent view: line wrapping not recalculated when switching back to a session
Title
[BUG] Agent view: line wrapping not recalculated when switching back to a session
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet (closest related: #8276, which is iTerm2/macOS-specific and about widening a pane, not agent view)
- [x] This is a single bug report
- [x] I am using the latest version of Claude Code
What's Wrong?
Problem:
When switching away from an agent view session and back (or attaching to a different background agent), previously rendered text shows incorrect/garbled line wrapping. The wrapping only corrects itself after manually resizing the terminal window.
Steps to Reproduce:
- Open
claude agents(agent view) on Windows Terminal - Attach to a background agent session with existing conversation output
- Switch away to a different agent/view, then switch back
- Observe: previous text now shows incorrect line wrapping (breaks in the wrong places, ragged right edge)
- Resize the terminal window (even slightly) - text reflows correctly
Expected Behavior:
Line wrapping should render correctly on switching back to a session, without requiring a manual window resize.
Actual Behavior:
Line wrapping is visibly wrong until a manual resize forces a full re-render.
What I already tried:
Set CLAUDE_CODE_ALT_SCREEN_FULL_REPAINT=1 (per the fullscreen rendering troubleshooting docs) both via env var and persisted with setx at the user level, then fully restarted the terminal application. This did not resolve the issue, which suggests it's a different bug than the documented ConPTY stale-cell coalescing issue - likely a hard-wrap reflow problem (wrap width cached from a prior render, not recalculated on reattach) similar in spirit to #8276 but occurring on session switch rather than explicit resize.
Environment:
- Platform: Windows 11
- Terminal: Windows Terminal
- Claude Code version: 2.1.211
CLAUDE_CODE_ALT_SCREEN_FULL_REPAINT=1set and confirmed active - no change in behavior
Is this a regression?
Unknown
Additional Information
Filed separately from #8276 because that issue is specific to iTerm2/macOS and pane-widening; this occurs in Windows Terminal on session switch/reattach in agent view, independent of any explicit resize action.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗