claude-code - 💡(How to fix) Fix Copying text from terminal output includes hard line breaks at every wrapped line [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#48037Fetched 2026-04-15 06:35:07
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
0
Participants
Timeline (top)
labeled ×2
RAW_BUFFERClick to expand / collapse

When copying text from Claude Code's terminal output, the clipboard contains hard newlines at the end of every display line (matching the terminal width), rather than preserving the original paragraph structure. This makes pasted text look broken, especially with larger font sizes where lines are shorter.

Steps to reproduce

  1. Use a terminal with a larger font size (fewer columns)
  2. Get a multi-sentence response from Claude Code
  3. Select and copy the text
  4. Paste into any editor

Expected

Paragraphs paste as continuous text, with newlines only where the original text had them.

Actual

Every visual line break becomes a hard newline in the clipboard. The copied text contains line breaks at every terminal-width boundary, making it unusable for pasting into documents, messages, etc.

Notes

  • The problem is worse with larger font sizes since lines are shorter and there are more artificial breaks
  • This affects all text output, including code explanations, summaries, and other prose

extent analysis

TL;DR

The issue can be mitigated by modifying the terminal output to preserve the original paragraph structure, potentially by adjusting the line wrapping or text formatting.

Guidance

  • Investigate the terminal settings or configuration to see if there's an option to disable line wrapping or preserve paragraph structure when copying text.
  • Consider using a different method to copy the text, such as using a command-line tool to extract the text without line breaks.
  • Look into adjusting the font size or terminal width to reduce the number of artificial line breaks, as a temporary workaround.
  • Examine the clipboard formatting to determine if there's a way to remove or replace the unwanted newline characters.

Example

No specific code snippet can be provided without more information on the terminal or system being used.

Notes

The solution may depend on the specific terminal emulator or operating system being used, and may require adjustments to system settings or configuration files.

Recommendation

Apply a workaround, such as adjusting terminal settings or using a different copy method, as the root cause of the issue appears to be related to the terminal's line wrapping behavior.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING