[Bug] Leading whitespace in drafted text output carries over when copied
Bug Description
Title: Leading whitespace in drafted text output carries over when copied
Description:
When Claude Code outputs text that the user intends to copy (emails, messages, drafts, etc.), the output often starts with leading whitespace or indentation. When the text is selected and copied from the terminal, that leading whitespace is
included in the clipboard contents and gets pasted into the destination (email client, Slack, etc.), requiring manual cleanup every time.
Steps to reproduce:
- Ask Claude Code to write an email or short piece of text
- Ask it again to rewrite without any leading formatting/spacing
- Select and copy the output from the terminal
- Paste into an email client or text editor
- Observe leading whitespace at the start of the pasted content
Expected behavior:
Drafted text intended to be copied verbatim should start flush-left with no indentation or leading blank characters, so the clipboard content is clean.
Actual behavior:
Output consistently includes leading whitespace, even after explicit requests not to include it. The whitespace appears to come from the terminal's rendering/wrapping of assistant text rather than the content itself.
Environment:
- Claude Code CLI
- macOS (Darwin 25.4.0)
- Shell: zsh
Impact:
Minor but recurring friction — every drafted message needs manual whitespace cleanup before sending.
Environment Info
- Platform: darwin
- Terminal: iTerm.app
- Version: 2.1.119
- Feedback ID: cddab0bc-d918-4859-9061-36a6734c4686
Errors
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗