[BUG] Cursor position and rendering corruption in long sessions on macOS (iTerm2)
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report
- [x] I am using the latest version of Claude Code
What's Wrong?
After a session runs long enough, the TUI rendering becomes corrupted in several ways:
- Cursor jumps — the input cursor teleports between the top border and the bottom border of the input area erratically
- Garbled transcript — previously rendered text in the conversation area becomes visually jumbled
- Input area displacement — the user input box is no longer anchored to the bottom of the terminal; it appears at inconsistent vertical positions
What Should Happen?
Input area stays anchored at the bottom, cursor stays within the input box, transcript renders cleanly.
Steps to Reproduce
- Start a long Claude Code session with many tool calls and large output
- Continue interacting until the session history is substantial
- Observe the input area and surrounding chrome
Error Messages/Logs
No explicit error output — this is a visual/rendering corruption.
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Claude Code Version
2.1.170 (first observed in 2.1.169)
Platform
Anthropic API
Operating System
macOS Sequoia (M4 Max)
Terminal/Shell
iTerm2
Additional Information
Likely a terminal resize/redraw issue related to accumulated scroll state or row-count miscalculation after the terminal history grows past a certain threshold. Possibly related to how the TUI recalculates layout on each render pass in long sessions.
Screenshots to follow in a comment (3 captures from separate sessions showing the corruption).
This issue has 10 comments on GitHub. Read the full discussion on GitHub ↗