[BUG] Agent view: scrolling inside attached session leaves stale left-column artifacts (Windows Terminal 2.1.141)
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
When attached to a session inside agent view (claude agents → select a row → Enter), scrolling the transcript leaves stale character cells in the leftmost columns. The artifacts appear to be fragments of previously rendered frames (markers such as X, 2., 3., //, ⚠, 🎯 from earlier content) that the redraw fails to clear.
Ctrl+L forces a full redraw and clears the artifacts, but they reappear on the very next scroll action.
Key observation: This bug is specific to the agent-view attach path. Launching a session directly with claude and scrolling produces NO artifacts. The stale left-column cells only appear when attaching to a session via claude agents → select row → Enter.
The transcript content that reliably triggers this contains:
- CJK (Traditional Chinese) text
- Box-drawing characters forming tables (
├─┼─┤,│, etc.) - Emoji status markers (✅ ❌ ⚠ 🎯)
- Mixed-width characters on the same line
Reproduction
- Have a session whose transcript contains CJK + a box-drawing table + emoji markers.
- Run
claude agents. - Select the session and press
Enterto attach. - Scroll up/down with mouse wheel or
PgUp/PgDn. - Observe stale character cells along the leftmost columns of the viewport.
- Press
Ctrl+L— artifacts clear. - Scroll again — artifacts return immediately.
- Exit agent view and launch
claudedirectly — scroll the same content — NO artifacts.
Environment
- Claude Code version: 2.1.141
- OS: Windows 11
- Terminal: Windows Terminal (default profile, default font: Cascadia Mono)
- Shell: PowerShell
CLAUDE_CODE_NO_FLICKER: tested with both0and1— both reproduce identically
What I've Already Ruled Out
- Not terminal-emulator specific. Reproduced identically on both Windows Terminal and WezTerm, so this is not a wide-character / column-width issue in the emulator.
- Not NO_FLICKER mode specific. Reproduces with
CLAUDE_CODE_NO_FLICKER=0and=1, suggesting the bug is in the higher-level diff/redraw layer rather than the rendering backend. - Not fixed by recent CHANGELOG entries. Running 2.1.141, which already includes:
- "Fixed scroll behavior in Windows Terminal and VS Code when attached to background sessions"
- "Fixed border-embedded text overflowing on CJK/emoji due to visual cell width miscalculation"
- "Fixed wide markdown tables leaving a stale bordered render in terminal scrollback while streaming"
These look related but do not cover this specific symptom.
<img width="1280" height="758" alt="Image" src="https://github.com/user-attachments/assets/9f745e02-6f06-40ea-a345-30c6ef0674c5" />
What Should Happen?
Scrolling the transcript should fully repaint every column on every scroll tick automatically, matching what Ctrl+L produces.
Error Messages/Logs
### Suspected Root Cause
The direct `claude` launch path does not reproduce this, which strongly suggests the bug is in the **attach/re-attach viewport initialization logic** — the code path that restores an existing session's transcript into the TUI — not in the general scroll rendering layer. Likely the incremental diff is failing to track column width correctly for mixed CJK / box-drawing / emoji content when the viewport is restored from a detached state.
### Screenshots
(請將我提供的兩張截圖 attach 在此處)
Steps to Reproduce
- Have a session whose transcript contains CJK + a box-drawing table + emoji markers.
- Run
claude agents. - Select the session and press
Enterto attach. - Scroll up/down with mouse wheel or
PgUp/PgDn. - Observe stale character cells along the leftmost columns of the viewport.
- Press
Ctrl+L— artifacts clear. - Scroll again — artifacts return immediately.
- Exit agent view and launch
claudedirectly — scroll the same content — NO artifacts.
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
Windows 11
Claude Code Version
2.1.141
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Windows Terminal
Additional Information
_No response_
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗