Trailing whitespace in terminal output when copying text
Description
When selecting and copying text from Claude Code's terminal output, the copied text contains trailing whitespace on most lines. This makes it difficult to copy clean text from the session window — for example, when copying a skill description or code block to paste elsewhere.
Steps to Reproduce
- Ask Claude to output a multi-line block of text (e.g., a markdown document with tables, bullet lists, code blocks)
- Select the output text in the terminal
- Paste it into an editor
Expected Behavior
Copied text should not contain trailing spaces beyond what was in the original content.
Actual Behavior
Nearly every line has trailing whitespace padding, visible when selecting text in the terminal (highlighted dark blocks extending to the right edge). This padding is included when copying.
Screenshot
Lines with trailing whitespace visible during selection:
<img width="1862" height="266" alt="Image" src="https://github.com/user-attachments/assets/b93a1037-a004-4d72-9a2b-c4a54ae98a13" />
Notes
- Writing the same content to a file produces clean output with no trailing spaces — the issue is specifically in the terminal rendering layer
- Markdown tables are especially affected due to column alignment, but plain text lines also get padded
- This affects usability when Claude Code is used to generate copy-pasteable content (documentation, skill descriptions, config snippets, etc.)
Environment
- Claude Code 2.1.76
- Terminal: various
- OS: Linux
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗