Output uses hard newlines for word wrap, breaking tmux copy mode
Problem
Claude Code wraps its text output by measuring the terminal/pane width and emitting actual newline characters at wrap points. This means tmux's copy mode treats every wrapped line as a separate line, because tmux sees hard newlines rather than soft wraps.
When copying Claude Code output in tmux copy mode, the yanked text includes newlines and leading whitespace at every wrap point, even though the content is logically a single paragraph.
Expected behavior
Long lines should be emitted as-is (without inserted newlines), allowing the terminal emulator to handle soft wrapping. This way, tmux's GRID_LINE_WRAPPED flag is preserved and copy mode yields the logical line.
Reproduction
- Run
claudeinside tmux - Get a response with paragraphs of text
- Enter tmux copy mode (
prefix + [) - Select and yank a paragraph
- Paste — the text contains newlines at the pane width boundaries
Compare with:
string repeat -n 300 '='
Copying this in tmux copy mode correctly yields one line, because the terminal soft-wrapped it.
Environment
- Claude Code CLI (latest)
- tmux 3.5+ with
set -g mouse onand vi copy mode - kitty terminal on Wayland (Hyprland)
- Arch Linux
Possible solution
Provide an option (e.g., outputWrapping: "soft" in settings.json) to emit long lines without inserted newlines, delegating word wrap to the terminal emulator. This would make tmux copy mode, terminal reflow on resize, and other terminal features work correctly with Claude Code output.
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗