[BUG] ANSI color codes corrupted by hard-coded line breaks - affects all long text output

Resolved 💬 2 comments Opened Jan 30, 2026 by 33moren33 Closed Jan 30, 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?

Claude CLI corrupts ANSI color codes and Markdown formatting when text wraps in terminal. Colors and formatting bleed into subsequent lines.
Once generated in narrow window, corruption is permanent even after widening window.

What Should Happen?

Colors and formatting should reset properly at line breaks. Text should dynamically adapt to terminal width without corruption. Window
resizing should trigger proper reflow.

Error Messages/Logs

No explicit errors. Visual symptoms:
  - Colors continue beyond intended text spans
  - Bold/italic formatting bleeds to following text
  - Code block syntax highlighting colors bleed between lines
  - Raw ANSI codes like [31m become visible as literal text
  - Table borders misalign after wrapping

Steps to Reproduce

Environment:

  • Claude Code: 2.1.23 (tested on 2.1.25 too)
  • OS: Windows 11
  • Terminal: Windows Terminal + Git Bash or powershell
  • TERM: xterm-256color

Steps:

  1. Open Claude CLI, resize window to 40-50 columns width
  2. Ask: "Generate a long warning (100+ chars), Python code block, and table"
  3. Observe: Colors/formatting break at wrap points
  4. Widen window to 80+ columns
  5. Observe: Corruption remains (permanent)

Claude Model

None

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.23 (Claude Code)

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

PowerShell

Additional Information

<img width="1920" height="1020" alt="Image" src="https://github.com/user-attachments/assets/6891cb13-d4f1-4e4a-882c-db777f0e3f55" />

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗