Copied text includes word-wrap line breaks
Problem
When Claude Code outputs a paragraph of text (e.g. notes, citations, descriptions), the terminal UI renders it with hard line breaks at the wrap boundary. When the user selects and copies this text, the clipboard contains unwanted newlines at every wrap point, making the copied text unusable without manual cleanup.
Example: Claude outputs a single-line note like:
Lane household on 1860 census. Mary listed as age 28, born Florida. D Lane is head, farmer from Virginia. All children born in Wisconsin.
When copied from the terminal, the clipboard contains:
Lane household on 1860 census. Mary listed as age 28, born Florida. D Lane is
head, farmer from Virginia. All
children born in Wisconsin.
Expected behavior
Copied text should not include line breaks introduced by word wrapping. The text should copy as a single paragraph, matching the original output.
Environment
- Windows 11 (10.0.26200)
- Windows Terminal 1.23.20211.0
- Shell: bash
Notes
This appears to be caused by Claude Code's TUI rendering text with actual newline characters in the terminal buffer rather than relying on the terminal's soft-wrap. Windows Terminal correctly copies what's in the buffer — the issue is upstream in how the text is written to the terminal.
Windows Terminal's own soft-wrap copy bug (microsoft/terminal#5113) was fixed in v1.0, so this is a separate issue.
4 Comments
Note: would be happy to submit a PR for this if the TUI rendering source code were available. The likely fix is using the terminal's soft-wrap instead of inserting hard newlines when rendering paragraph text.
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
Closing as duplicate of #15199 which comprehensively covers this issue and references other related reports (#6827, #13378). Adding a +1 there.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.