[BUG] Multi-line paste still loses newlines in cmux + tmux (different root cause from #43167)

Resolved 💬 2 comments Opened Apr 21, 2026 by pb-sameerreddy Closed Apr 22, 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?

Multi-line paste collapses to one line in Claude Code's prompt when running inside cmux + tmux. The fix shipped for #43167 (which addressed tmux's extended-keys-format csi-u re-encoding CR inside bracketed paste) does not cover this case — for me, tmux is not
re-encoding anything. Bytes arrive at the application cleanly with \n separators intact, and Claude Code drops the newlines anyway.

The same Claude Code 2.1.112 build, same tmux config, same pasted content, in the VSCode integrated terminal preserves the newlines. So the trigger is something cmux-specific that happens above the tmux layer (probably a terminal capability reply, e.g. kitty keyboard
protocol negotiation, that branches Claude's paste tokenizer).

What Should Happen?

Pasted multi-line text should preserve line breaks in Claude Code's prompt, as it does in:

  • A plain shell pane in the same tmux session in cmux (newlines preserved)
  • Claude Code 2.1.112 in the VSCode integrated terminal + same tmux config (newlines preserved)

Error Messages/Logs

Steps to Reproduce

  1. Open cmux (desktop terminal app), launch tmux 3.5a inside it, launch claude.
  2. Copy a 3-line block to the clipboard, e.g.

LINE-A
LINE-B
LINE-C

  1. Paste into Claude's prompt → text appears as one line: LINE-A LINE-B LINE-C.

Control test (proves terminal stack delivers clean bytes):

In a plain shell pane in the same tmux session, run:
printf '\e[?2004h' && cat | od -c; printf '\e[?2004l'
Paste the same 3-line block, press Ctrl+D. Output (abridged):
033 [ 2 0 0 ~ L I N E - A \n L I N E - B \n L I N E - C 033 [ 2 0 1 ~
Bracketed-paste markers present, \n separators intact. tmux is not re-encoding CR here.

Toggling the tmux options that fixed #43167 has zero effect:
tmux set -s extended-keys off
tmux set -as terminal-features 'xterm*'
Claude Code still collapses pastes; shell paste in the same pane still preserves newlines.

Outer terminal that triggers the bug: cmux
Outer terminal that does NOT trigger the bug: VSCode integrated terminal (same Claude version, same tmux)
Multiplexer: tmux 3.5a
OS: macOS 24.6.0
Env inside tmux (identical in both terminals): TERM=tmux-256color, TERM_PROGRAM=tmux, COLORTERM=truecolor

Related:

  • #43167 — Multi-line paste loses newlines when tmux extended-keys-format is csi-u (closed COMPLETED 2026-04-03)
  • #43169 — Same symptom, locked duplicate of #43167

Claude Model

None

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.116

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Other

Additional Information

_No response_

View original on GitHub ↗

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