[BUG] Ctrl+G editor: pasting text (Cmd+V) produces duplicated/garbled output in tmux
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
- Run Claude Code inside tmux (tmux 3.5a, TERM=screen-256color)
- Press Ctrl+G to open the editor (Vim 9.1)
- Press i to enter insert mode
- Paste any multi-line text with Cmd+V
- 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.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗