Output uses hard newlines for word wrap, breaking tmux copy mode

Resolved 💬 4 comments Opened Apr 1, 2026 by jaehho Closed May 12, 2026

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

  1. Run claude inside tmux
  2. Get a response with paragraphs of text
  3. Enter tmux copy mode (prefix + [)
  4. Select and yank a paragraph
  5. 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 on and 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.

View original on GitHub ↗

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