[BUG] bracketed paste through ssh and tmux is not working
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?
Set of experiments with claude code 2.1.45.
- xterm → tmux → Claude Code (Ctrl-G vim): paste works (host)
- xterm → SSH → tmux → Claude Code (Ctrl-G vim): paste broken (remote)
- xterm → SSH → tmux → vim (standalone): paste works (remote)
- xterm → SSH → tmux → Claude Code (regular input): paste works (remote)
- xterm → SSH → Claude Code (no tmux, Ctrl-G vim): paste works (remote)
The issue is specifically the combination of SSH + tmux + Claude Code's Ctrl-G vim. Each pair works, but all three together breaks.
Suggestions is that when Claude Code's TUI spawns vim via Ctrl-G, the way it sets up the child PTY doesn't correctly propagate the bracketed paste mode through the SSH + tmux layers. Standalone vim in tmux over SSH works because vim negotiates directly with the tmux PTY. But Claude Code's TUI interposes an additional PTY, and that extra layer loses the bracketed paste capability when SSH is also in the path.
This seems like a Claude Code bug
What Should Happen?
Bracketed paste should work
Error Messages/Logs
Steps to Reproduce
Reproduction:
- SSH to remote host
- Start tmux
- Run Claude Code
- Press Ctrl-G to open vim editor
- Paste text. Bracketed paste sequences are not handled, text is interpreted as vim commands
The workaround for now is to paste into the regular input (without Ctrl-G) when working on the remote
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.45 (Claude Code)
Platform
Anthropic API
Operating System
Other Linux
Terminal/Shell
Xterm
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗