Terminal: ANSI colors reset after first character on diff lines
Description
When running git diff --color=always (or any command that outputs colored diff lines) in Claude Code's terminal, the ANSI color codes are not applied to the full line. The +/- prefix character is colored correctly (green/red), but the rest of the line resets to white/default.
This works correctly in a standard terminal (iTerm2, Terminal.app, VS within the claude terminal).
Repro
Run any colored diff in Claude Code's terminal:
git diff --color=always
Or:
echo -e '\033[32m+this entire line should be green\033[0m'
Expected
The entire added line is green, the entire deleted line is red — matching standard terminal behavior.
Actual
Only the + or - character is colored. The rest of the line renders in the default text color.
Screenshots
Normal terminal (correct):
<img width="670" height="276" alt="Image" src="https://github.com/user-attachments/assets/fac1c61e-c85d-4eb1-b291-09b256024a45" />
Claude Code terminal (incorrect):
<img width="610" height="224" alt="Image" src="https://github.com/user-attachments/assets/ed470936-fff0-4f6c-bde5-130bd7ddfa7f" />
(Screenshots show a custom git wrapper tool which calls git diff --color=always under the hood. The normal terminal colors the full line; Claude Code only colors the first character.)
Environment
- Claude Code version: 2.1.91 (visible in screenshot)
- Platform: macOS (Darwin 24.6.0)
- Terminal: claude code terminal vs iTerm2
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗