[BUG] iTerm2: Display duplication and paste misplacement

Resolved 💬 3 comments Opened Dec 29, 2025 by EmanuelFaria Closed Jan 1, 2026

Preflight Checklist

  • [x] I have searched existing issues — this relates to #778, #407, #10413
  • [x] This is a single bug report

Environment

  • Platform: Anthropic API
  • Claude CLI version: v2.0.76
  • Operating System: macOS
  • Terminal: iTerm2 (issue does NOT occur in Apple Terminal)

Bug Description

Two issues occurring specifically in iTerm2:

1. Display Duplication

The Claude Code interface renders the same output dozens of times. Pressing / to open the slash command menu results in the menu being displayed 50-100+ times in succession, creating a massive wall of duplicated text.

This appears related to #778 (ctrl-r flickering) and #10413 (command line displayed many times), but occurs with different triggers.

2. Paste Misplacement

When pasting from clipboard (Cmd+V), content sometimes appears at a location other than where the cursor is positioned — beginning of line, end of line, or previous line.

Steps to Reproduce

Display Duplication:

  1. Open Claude Code in iTerm2
  2. Type / to open slash command menu
  3. Observe menu rendering 50-100+ times

Paste Misplacement:

  1. Open Claude Code in iTerm2
  2. Start typing a prompt
  3. Position cursor mid-prompt
  4. Paste clipboard content (Cmd+V)
  5. Content appears at wrong position

Expected Behavior

  • Slash command menu renders once
  • Paste inserts at cursor position

Actual Behavior

  • Interface elements render dozens of times
  • Paste inserts at unpredictable locations

Workaround

Using Apple Terminal instead of iTerm2 avoids both issues.

Related Issues

Claude Code:

  • #778 — ctrl-r causes convulsive flickering in iTerm2
  • #407 — Terminal rendering fails completely (buffering issue)
  • #10413 — Terminal display broken, command line displayed many times

iTerm2 GitLab:

  • #11228 — Paste doubles clipboard content
  • #10454 — Copy/paste severely messed up
  • #6701 — Cursor position off by one

Additional Context

This may be an interaction between Claude Code's TUI renderer (Ink/React) and iTerm2's escape sequence handling or GPU rendering. The pattern suggests either:

  1. Claude Code is emitting redundant render cycles that iTerm2 doesn't deduplicate
  2. iTerm2 is misinterpreting cursor positioning escape sequences from the TUI

The fact that Apple Terminal works correctly suggests the issue is specific to how iTerm2 handles Claude Code's terminal output.

View original on GitHub ↗

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