[BUG] Agent view: line wrapping not recalculated when switching back to a session

Status Closed — duplicate
Reported on v2.1.211
Maintainer reply None cached
Activity 2 comments · opened Jul 16, 2026 · closed Jul 20, 2026

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:

  1. Open claude agents (agent view) on Windows Terminal
  2. Attach to a background agent session with existing conversation output
  3. Switch away to a different agent/view, then switch back
  4. Observe: previous text now shows incorrect line wrapping (breaks in the wrong places, ragged right edge)
  5. 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=1 set 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.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗