Problem
When a user exits Claude Code (or any alternate screen buffer app like vim) and then reattaches to the session, the terminal shows a screen full of repeated bash prompts and residual rendering artifacts.
Root Cause
The output buffer (deque of last 1000 chunks) accumulates raw PTY output including alternate screen enter/exit sequences. On reattach, _doAttach() replays the entire buffer, causing the alternate screen sequences and stale prompts to render.
Expected Behavior
After reattach, the terminal should show a clean screen with the current shell prompt.
Fix
Send a screen clear and resize after reattach to force a clean terminal state.
Fixed in #119.
Problem
When a user exits Claude Code (or any alternate screen buffer app like vim) and then reattaches to the session, the terminal shows a screen full of repeated bash prompts and residual rendering artifacts.
Root Cause
The output buffer (deque of last 1000 chunks) accumulates raw PTY output including alternate screen enter/exit sequences. On reattach,
_doAttach()replays the entire buffer, causing the alternate screen sequences and stale prompts to render.Expected Behavior
After reattach, the terminal should show a clean screen with the current shell prompt.
Fix
Send a screen clear and resize after reattach to force a clean terminal state.
Fixed in #119.