Copying code blocks from TUI adds leading whitespace
Description
When copying code blocks from Claude Code's TUI output, the copied text includes leading whitespace (spaces) that are not part of the actual content. This is visual padding used for rendering markdown code blocks, but terminals copy it as content.
Steps to reproduce
- Have Claude output a code block (e.g. a config file snippet or shell command)
- Select and copy the code block text from the terminal
- Paste it elsewhere (e.g. into nano, another terminal, etc.)
Expected behavior
Copied text should not include the visual padding/indentation added by the TUI renderer.
Actual behavior
Every line gets 2 extra leading spaces prepended, making pasted content incorrect for whitespace-sensitive contexts (heredocs, YAML, etc.) and annoying for everything else.
Impact
Makes it difficult to use Claude Code for generating config snippets, commands, or code that needs to be pasted into other terminals or editors — a common workflow when managing remote servers.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗