[BUG] Ctrl+G editor: pasting text (Cmd+V) produces duplicated/garbled output in tmux

Resolved 💬 2 comments Opened Apr 20, 2026 by bugok Closed Jun 27, 2026

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 opening an editor via Ctrl+G (e.g. Vim), pasting text with Cmd+V produces duplicated/garbled output.
The pasted text appears repeated and mangled, regardless of Vim's paste mode setting (:set paste or
pastetoggle). This only occurs in the Ctrl+G editor — pasting in Vim outside of Claude Code works
correctly, even in the same tmux session.

What Should Happen?

Text pasted with Cmd+V into the Ctrl+G editor should appear exactly once, unmodified, matching the
clipboard contents.

Error Messages/Logs

No error messages. The symptom is duplicated/garbled text in the editor buffer after pasting. For
  example, pasting a two-line URL produces six lines with the content repeated multiple times.

Steps to Reproduce

  1. Run Claude Code inside tmux (tmux 3.5a, TERM=screen-256color)
  2. Press Ctrl+G to open the editor (Vim 9.1)
  3. Press i to enter insert mode
  4. Paste any multi-line text with Cmd+V
  5. Observe that the pasted text is duplicated/mangled

Suspected cause: Claude Code's PTY input handling remains active during the Ctrl+G editor subprocess, so
both Claude Code and Vim read the pasted input from the PTY, producing duplicated text.

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.1.111

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

iTerm2

Additional Information

My full setup is iTerm2 running et, connecting to a remote Linux machine, running tmux on that machine, and running claude CLI on that terminal.

View original on GitHub ↗

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