[BUG] Copied text contains extra formatting characters
Resolved 💬 4 comments Opened Aug 4, 2025 by dstolts Closed Aug 15, 2025
Environment
- Platform (select one):
- [x] Anthropic API
- [ ] AWS Bedrock
- [ ] Google Vertex AI
- [ ] Other: <!-- specify -->
- Claude CLI version: <!-- Run
claude --versionin PowerShell to get this --> - Operating System: Windows 11
- Terminal: PowerShell (Windows Terminal)
Bug Description
When copying text from my own chat input in Claude Code, extra formatting characters (spaces and vertical bars) are added to the copied text, making it impossible to reuse previously typed commands or text.
Steps to Reproduce
- Type a multiline command or text in the Claude Code chat input box
- don't Send the message
- Try to copy the text from your own input in the chat window
- Paste the copied text into a text editor or terminal
Expected Behavior
The copied text should be exactly what was typed, without any additional formatting characters, spaces, or vertical bars.
Actual Behavior
The copied text includes:
- Extra spaces at the beginning of lines
- Vertical bars (|) or other formatting characters
- Additional whitespace that wasn't in the original input
Example:
Original typed: npm start
What gets copied: | npm start or similar with extra formatting
Additional Context
- This issue makes it very difficult to reuse commands from chat window
- Related to issue #4686 but specifically affects copying from user's own input, not Claude's output
- Significantly impacts productivity when working with complex and multi-line commands
- Forces users to retype everything instead of copying from their own chat window or opening an .md file to paste then cleanup the formatting
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗