[BUG] Commands in plain text output are wrapped with real newlines, making copy-paste impossible
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?
When Claude outputs a command as plain text (no code block), the Claude Code terminal wraps long
lines by inserting real newline characters rather than visual-only wrapping. When the user copies
and pastes the command, it arrives in the terminal split across multiple lines, breaking it
entirely.
The same problem affects code blocks: continuation lines in a multi-line code block have leading
spaces inserted, which also break commands on paste.
The formatting issue is visible in the description above as this was generated by CC and copied/pasted unmodified.
What Should Happen?
Expected behaviour: Long lines should wrap visually only. Copy-paste should produce the full
command as a single unbroken string.
Error Messages/Logs
Steps to Reproduce
- Open Claude Code terminal
- Ask Claude: "Print this as plain text: docker run --rm --env-file /root/wallboxTeslamate/.env
-v /root/wallboxTeslamate:/scripts root-wallbox-poller python /scripts/explore_sessions.py"
- Copy the output and paste it into a terminal window
- Observe that the command arrives split across two lines at the point where it wrapped in the
Claude Code display
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.170 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗