Statusline ANSI escape codes not rendering properly with Unicode terminal
Status Closed — not planned
Maintainer reply None cached
Activity 11 comments · opened Aug 27, 2025 · closed Jan 6, 2026
Issue Description
The Claude Code statusline is displaying raw ANSI escape codes instead of rendering them as colors when using a Unicode-enabled terminal.
Expected Behavior
Statusline should display colored text like:
- Model name in cyan
- Directory path in blue
- Git branch in appropriate colors
- Usage indicators with color coding
Actual Behavior
Statusline shows raw escape sequences like:\033[33mmain\033[0m* instead of colored text
Environment
- macOS Darwin 24.6.0
- Terminal: Unicode enabled
- Claude Code with custom statusline script
- Zsh with Powerlevel10k theme
Reproduction Steps
- Configure custom statusline script in
~/.claude/settings.json - Script outputs ANSI escape codes using printf
- Statusline displays raw codes instead of colors
Technical Details
The statusline script uses standard ANSI escape codes:
\033[33mfor yellow text\033[0mfor reset\033[96mfor bright cyan
These work correctly in terminal but not in Claude Code's statusline rendering.
Possible Causes
- Claude Code statusline renderer doesn't support ANSI escape codes
- Unicode terminal handling different from ASCII
- Need different escape sequence format for Claude Code
Requested Solution
Either:
- Enable ANSI escape code rendering in statusline
- Document proper color formatting for statuslines
- Provide alternative color formatting method
This affects users who want colored, informative statuslines for better UX.
11 Comments
@shadowkon007 The statusline definitely supports ANSI escape codes. I use them extensively in ccstatusline in 16 / 256 / truecolor modes and they output just fine in Terminal.app (16 / 256 only), iTerm2, ghostty, and VSCode.
I just updated my settings.json to this:
and here is the result in ghostty:
<img width="391" height="87" alt="Image" src="https://github.com/user-attachments/assets/574e2377-5b25-4421-8fc7-f95d87d2f83d" />
and in Terminal.app:
<img width="239" height="62" alt="Image" src="https://github.com/user-attachments/assets/c7a8e60c-4d9c-4a54-80d8-60f6476114dc" />
Perhaps you can post a more complete example that I can test in my own settings.json and try to recreate.
I do experience the same issue since about a week. could either be a change in Claude Code or OS X as I am running OX Tahoe beta 7 since about that same time. The issue is specifically with Unicode.
Is this only in Terminal.app on macOS 26? How about iTerm2 or ghostty?
Yes. It is in the Terminal.app on macOS 26.
iTerm2 gives (in Unicode and xterm-256color mode) the same result as terminal and the terminal built-in in vsCode, that is: escape sequences spelled out rather than interpreted - by the looks of it.
This used to be working fine. I am not sure if it was the macOS beta 6 -> 7 update or one of the many Claude Code updates that broke the feature.

Can you put this in your settings.json:
and screenshot the result? Seems odd that every terminal has the same issue when they have entirely different rendering pipelines.
That seems to work well!
I regenerated the status line and it generated a much simpler (but working) status line.

/statuslineis giving me this issue. But this snippet seems to work, not sure what is happening. I think the generated script isn't working properlyThat's understandable.
/statuslinejust uses the LLM to code a statusline script with whatever you want, so I'm assuming it doesn't know all the intricacies of the ANSI color issues and resets. You can always try giving the/statuslinecommand an example of a working printf statement with ANSI color codes so it knows how to handle the reset codes properly. Alternatively you can give my ccstatusline a try and see if it works for your needs.This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.