claude-code - 💡(How to fix) Fix [FEATURE] Provide the ability to disable indentation in CLI for clipboard to function properly [2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#51794Fetched 2026-04-22 07:52:40
View on GitHub
Comments
2
Participants
2
Timeline
5
Reactions
0
Author
Timeline (top)
commented ×2labeled ×2renamed ×1
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing requests and this feature hasn't been requested yet
  • This is a single feature request (not multiple features)

Problem Statement

There are duplicates for this problem but they are all closed due to inactivity but I feel they deserve to be reopened. It's frustrating not being able to use a clipboard with Claude CLI.

Description

When Claude Code outputs multi-line code blocks (e.g., shell commands), the rendered output includes horizontal padding on both sides. When a user selects and copies this text from the terminal to paste into another terminal or SSH session, the padding characters get included in the copied text, breaking the command.

Steps to Reproduce

Ask Claude Code to output a multi-line shell command in a code block Select the rendered output in the terminal Copy and paste it into another terminal window or SSH session Expected Behavior

Copied text from code blocks should be clean and directly pasteable without extra whitespace or padding characters.

Actual Behavior

The padding around the code block content gets included when copying, which breaks the pasted command.

Impact

This is especially painful when Claude outputs commands that need to be run on a remote server (where Claude can't execute them directly). The user has to manually clean up every pasted command, which defeats the purpose of having Claude generate them.

Proposed Solution

Provide a setting to disable indentation, or allow us to ask claude for output without indentation.

Alternative Solutions

No response

Priority

Medium - Would be very helpful

Feature Category

CLI commands and flags

Use Case Example

No response

Additional Context

No response

extent analysis

TL;DR

The issue can be mitigated by implementing a feature to remove or disable indentation in Claude Code's output for multi-line code blocks.

Guidance

  • Investigate the current rendering logic for code blocks in Claude Code to understand how the padding is being added.
  • Consider adding a configuration option or flag to disable indentation for code blocks, as proposed in the issue.
  • Evaluate the impact of removing indentation on the overall user experience and readability of the output.
  • If a configuration option is not feasible, explore alternative solutions such as providing a "copy to clipboard" feature that strips unnecessary whitespace.

Example

No code example is provided as the issue does not include specific implementation details.

Notes

The solution may require changes to the rendering engine or output formatting of Claude Code, and careful consideration should be given to the potential impact on other features or use cases.

Recommendation

Apply a workaround, such as manually removing indentation when copying and pasting code blocks, until a more permanent solution can be implemented, as adding a configuration option or flag to disable indentation seems to be the most straightforward solution.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING