[bug] Unexpected Line Breaks in Terminal Output Rendering
Bug Description
Claude Code incorrectly inserts hard line breaks in terminal output
Issue Description:
Claude Code is inserting actual newline characters into command output when lines exceed the terminal width, rather than outputting continuous text and allowing the terminal emulator to handle visual wrapping. This behavior differs from standard Unix tools and causes issues when copying or processing the output.
Expected Behavior:
Long lines should be output as continuous text without embedded newlines, allowing the terminal emulator to handle visual line wrapping. This is how standard Unix/Linux commands behave (e.g., echo, cat, grep, etc.).
Actual Behavior:
Claude Code appears to pre-wrap text by inserting hard line breaks at the terminal width boundary, creating actual newline characters in the output stream.
Steps to Reproduce:
- Use Claude Code to generate a bash script with long echo statements or commands that produce long lines
- Run the script in a terminal
- Observe that the output contains actual newline characters at the wrap points (visible as green arrows or continuation indicators in some terminals)
- Compare with the same script run through other tools - they output continuous lines that wrap visually but don't contain embedded newlines
Impact:
Output cannot be properly copied and pasted
Inconsistent with Unix/POSIX standard behavior
Example:
When outputting a long find command or echo statement, Claude Code breaks it mid-line with actual newlines, while the same command run directly in bash outputs as one continuous line that wraps visually only.
Suggested Fix:
Claude Code should output text as continuous streams and rely on the terminal emulator's built-in line wrapping capabilities, matching the behavior of standard Unix tools.
Environment Info
- Platform: darwin
- Terminal: vscode
- Version: 1.0.83
- Feedback ID:
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗