[BUG] Code block copy adds trailing newline causing >> in PowerShell
Status Open
Reported on v2.1.281
Maintainer reply None cached
Activity 1 comment · opened Sep 25, 2026
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?
copying a single-line command from a code block in the VS Code extension adds a trailing newline, which PowerShell interprets as a continuation prompt
What Should Happen?
Copying a single-line command from a code block should copy only the command text, without a trailing newline, so it executes immediately when pasted into PowerShell without triggering the >> continuation prompt.
Error Messages/Logs
Steps to Reproduce
- Open Claude Code VS Code extension
- Ask Claude for a PowerShell command - it responds with a fenced code block containing a single line
- Click the copy button on the code block
- Paste into a PowerShell terminal (Windows PowerShell 5.1)
- The command appears followed by >> on the next line, indicating PowerShell received a trailing newline and is waiting for more input,
6.User must press Enter again to execute
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.281
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
PowerShell
Additional Information
_No response_
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗