[BUG] Markdown output does not display correctly due to leading whitespace
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?
Claude Code adds a 2 space padding on each row of output that it dumps to stdout in a prompt response. Here's a screenshot:
<img width="2842" height="970" alt="Image" src="https://github.com/user-attachments/assets/9dd382f3-46a8-45c4-9243-ea5c34072674" />
What Should Happen?
Account for the leading whitespace per line, and reduce the term width by that amount to determine what the max display width of each line should be, before writing it to stdout.
Or simply just remove this leading whitespace. It adds NO value. It hinders copy/paste, breaks markdown tables. I don't see how this makes the output "visually appealing".
Error Messages/Logs
Steps to Reproduce
- Open claude code
- Ask it to generate wide markdown tables
- See the wrapping break due to the leading whitespace (that's not accounted for in the term width, which is now reduced by the leading pointless whitespace)
Claude Model
Other
Is this a regression?
No, this never worked
Last Working Version
_No response_
Claude Code Version
2.0.76 (Claude Code)
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
Other
Additional Information
_No response_
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗