[BUG] Copied text includes trailing whitespace padding to terminal width

Status Fixed / completed
Reported on v2.1.17
Maintainer reply None cached
Activity 3 comments · opened Jan 23, 2026 · closed Jan 23, 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?

When I copy text from Claude Code's terminal output, every line includes trailing spaces that pad to the full terminal
width. Pasting into any editor shows hundreds of extra space characters. This happens with all Claude output, not just
specific commands.

To reproduce: run any prompt in Claude Code, select and copy the response, paste into an editor that shows whitespace.

What Should Happen?

Copied text should only include the actual content without trailing whitespace padding.

Error Messages/Logs

Steps to Reproduce

  1. Run Claude Code in terminal
  2. Get any response from Claude
  3. Select and copy the output text
  4. Paste into any text editor that shows whitespace (or run pbpaste | cat -A on macOS)

Claude Model

Not sure / Multiple models

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.17 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

<img width="686" height="304" alt="Image" src="https://github.com/user-attachments/assets/4336196f-7629-4197-bce1-393c96bdce64" />

View original on GitHub ↗

3 Comments

github-actions[bot] · 8 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/18041
  2. https://github.com/anthropics/claude-code/issues/18798
  3. https://github.com/anthropics/claude-code/issues/18170

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

esaruoho · 8 months ago

#18170 this is the one i'll follow

github-actions[bot] · 8 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.