Shell prompt with ANSI color codes renders as raw escape sequences

Status Closed — not planned
Maintainer reply None cached
Activity 4 comments · opened Feb 13, 2026 · closed Apr 3, 2026

Description

When using a custom zsh prompt that includes ANSI color codes (via %{$fg[...]%} sequences), Claude Code's directory/prompt display renders the raw escape sequences instead of either stripping them or interpreting them.

Reproduction

  1. Configure a custom zsh PROMPT with color sequences, e.g.:
PROMPT='$(python_venv)%{$fg[blue]%}%~%{$reset_color%}$(git_branch) %{$fg[white]%}$%{$reset_color%} '
  1. Launch Claude Code
  1. The prompt/directory display shows:
(\033[32mvenv\033[0m) /Users/user/project (\033[33mmain\033[0m)

Expected behavior

The display should either:

  • Strip ANSI escape codes and show plain text: (venv) ~/project (main)
  • Render the colors correctly

Environment

  • macOS (Darwin 25.2.0)
  • Shell: zsh
  • Claude Code (latest)

View original on GitHub ↗

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