Skip to content

Code blocks in terminal output cause copy/paste issues #48247

Description

@tvpmb

Description

When Claude Code outputs a command in a code block for the user to copy/paste and run manually (e.g., a sudo command that cannot be run from within the session), the terminal rendering/formatting makes it difficult to cleanly copy the command. The user had to manually fix the copied text before it would run correctly.

Steps to Reproduce

  1. Claude Code outputs a command in a code block that the user needs to run manually
  2. User attempts to copy the command from the terminal output
  3. Pasted command includes formatting artifacts or does not paste cleanly

Expected Behavior

Commands displayed for manual execution should be easily and accurately copy/pasteable from the terminal.

Environment

  • Claude Code 2.1.87 (at time of issue)
  • macOS (Darwin 25.2.0)
  • Shell: bash

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions