[BUG] Command suggestions with line continuations have trailing whitespace after backslashes

Status Fixed / completed
Maintainer reply ✓ Yes — claude[bot]
Activity 7 comments · opened Apr 17, 2026 · closed May 17, 2026
💡 Likely answer: A maintainer (claude[bot], contributor) responded on this thread — see the highlighted reply below.

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

When Claude suggests a command line to run it puts it on multiple lines with a \ at the end of each line. However the CLI seems to have loads of spaces after the \ so copying that and pasting it into a terminal doesn't work.

What Should Happen?

The script suggested should work when copied and pasted from the terminal.

Error Messages/Logs

$ aws ecs describe-task-definition \                                                                                                                                                              
    --task-definition weaviate-node1-prod \                                                                                                                                                                                     
    --region eu-west-2 \                                                                                                                                                                                                        
    --query 'taskDefinition.containerDefinitions[0].healthCheck'

usage: aws [options] <command> <subcommand> [<subcommand> ...] [parameters]
To see help text, you can run:

  aws help
  aws <command> help
  aws <command> <subcommand> help

aws: error: the following arguments are required: --task-definition

zsh: command not found: --task-definition
zsh: command not found: --region
zsh: command not found: --query

Steps to Reproduce

  1. Ask Claude for a command line that will go over more than one line. For example "give me a command line to call the GitHub http API using curl to post a new issue"
  2. Copy the output
  3. Paste the output into a terminal
  4. Fail to run it

Claude Model

Not sure / Multiple models

Is this a regression?

No, this never worked

Last Working Version

_No response_

Claude Code Version

1.1.111

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

IntelliJ IDEA terminal
(Also other terminals such as the one built into MacOS)

Additional Information

_No response_

View original on GitHub ↗

7 Comments

mjaggard · 4 months ago

Duplicate of #36312 because that silently got closed.

mjaggard · 4 months ago

Note, this does work correctly in the Fullscreen TUI, just not in the standard TUI.

mjaggard · 4 months ago

Hi team — just checking in on this one. It's been about 10 days since the last update. Is there any progress or additional information needed from my end? Thanks!

mjaggard · 3 months ago

Hi team — following up again on this issue. It's been over a week since my last comment with no response. Could someone let me know if this is on the radar, or if there's anything further I can provide to help? Thanks!

archer-eric · 3 months ago

This is fixed for me. It may have been this release note:

v2.1.136 (2026-05-08): Fixed trailing whitespace in copied terminal output during streaming
claude[bot] contributor · 3 months ago

This issue was fixed as of version 2.1.136.

github-actions[bot] · 1 month ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.