[BUG] Display duplication and paste misplacement in iTerm2
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported
- [x] This is a single bug report
Environment
- Platform: macOS
- Claude CLI version: v2.0.76
- Terminal: iTerm2 (issue does NOT occur in Apple Terminal)
- Model: Opus 4.5
Bug Description
Two issues occurring specifically in iTerm2 (not reproducible in Apple Terminal):
1. Display Duplication
The Claude Code interface renders the same output dozens of times. For example, pressing / to open the slash command menu results in the menu being displayed 50+ times in succession, creating a massive wall of duplicated text.
Similarly, error messages like:
Session b2d3b7bf-c89b-46d1-91fc-186b0e721556 was not found.
...appear repeated dozens of times when they should appear once.
2. Paste Misplacement
When pasting from clipboard (Cmd+V), the content sometimes appears at a location other than where the cursor is positioned. This makes editing prompts unreliable.
Steps to Reproduce
Display Duplication:
- Open Claude Code in iTerm2
- Type
/to open slash command menu - Observe the menu rendering multiple times
Paste Misplacement:
- Open Claude Code in iTerm2
- Start typing a prompt
- Position cursor mid-prompt
- Paste clipboard content
- Content appears at wrong position (beginning, end, or previous line)
Expected Behavior
- Slash command menu should render once
- Paste should insert at cursor position
Actual Behavior
- Interface elements render 20-100+ times
- Paste inserts at unpredictable locations
Workaround
Using Apple Terminal instead of iTerm2 avoids both issues.
Additional Context
This may be related to how Claude Code's TUI handles iTerm2's proprietary escape sequences or rendering optimizations. The issues seem to occur more frequently during rapid input or after the session has been running for a while.
Screenshots / Logs
Terminal log showing / command menu duplicated ~100 times attached. Each block below appeared as a separate render:
/ARCHIVE_COMMAND 📦 Archive Command Usage (project)
/archive-check Please check the status of terminal
transcript archives in the project.
(project)
...
(This identical block repeated 100+ times in a single session)
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗