Copied text includes 2-space leading indentation from rendered output

Open 💬 10 comments Opened Mar 23, 2026 by fotodeveloper

Description

When copying text from Claude Code CLI output in the terminal, each line includes 2 leading spaces that come from the rendering padding. This makes pasted text incorrectly indented, requiring manual cleanup every time.

Steps to reproduce

  1. Run Claude Code in any terminal (iTerm2, Terminal.app, etc.)
  2. Ask Claude any question that produces a text response
  3. Select and copy part of the response
  4. Paste into any text editor

Expected behavior

Copied text should not include the visual padding/margin used for rendering. The clipboard content should match the logical content, not the visual layout.

Actual behavior

Every line of copied text starts with 2 extra spaces. For example, copying a code snippet or explanation results in:

  This is the first line
  This is the second line

instead of:

This is the first line
This is the second line

Impact

  • Pasting code snippets requires manual dedent every time
  • Pasting into chat/docs/emails looks incorrectly formatted
  • Rectangular selection (Alt+drag) is a workaround but not ergonomic for multi-line copies

Suggested fix

Either:

  • Strip the leading padding from the content that the terminal receives (render visually but don't embed in character stream), or
  • Provide a config option to control output padding (e.g., output.padding: 0)

Environment

  • Claude Code: latest
  • Terminal: iTerm2 (also reproducible in Terminal.app)
  • OS: macOS

View original on GitHub ↗

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