[BUG] Claude CLI adds special chars when copy/pasting command from output

Resolved 💬 3 comments Opened Mar 11, 2026 by prmichaelsen Closed Mar 15, 2026

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?

Copy and pasting a multi-line command from claude CLI output to a terminal produces "invisible" whitespace invalid chars that break commands

What Should Happen?

Copy and paste should format exactly as presented

Error Messages/Logs

None

Steps to Reproduce

Create dummy bash command across multi lines, using / and && 
> echo "Step 1" && \                                                                                                       
>  echo "Step 2" && \
>  echo "Done!"
# copy paste into terminal
# run
echo "Step 1" && \                                                                                                       
  echo "Step 2" && \
  echo "Done!"
# out
zsh: command not found:  
Step 2
zsh: command not found:  
Done

Claude Model

None

Is this a regression?

No, this never worked

Last Working Version

N/A

Claude Code Version

2.1.72 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

_No response_

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗