Skip to content

Add NO_COLOR and --no-color support #1545

@waldekmastykarz

Description

@waldekmastykarz

Parent: #1534

Problem

Dev Proxy uses ANSI colors in human-mode output with no way to disable them. There's no support for:

When an agent accidentally runs in human mode (without --output json), ANSI escape codes end up in the captured output, making it harder to parse.

Rationale

NO_COLOR is a widely adopted standard. Supporting it is low effort and prevents edge-case parsing failures for agents and CI systems that capture output.

Proposed solution

  1. Respect NO_COLOR environment variable — if set (any value), disable ANSI colors
  2. Respect TERM=dumb — disable colors
  3. Optionally add --no-color flag for explicit control
  4. When colors are disabled, use the same text content but without ANSI escape sequences

Affected code

  • DevProxy/Logging/ProxyConsoleFormatter.cs — color output logic
  • DevProxy/Logging/AnsiParser.cs — ANSI handling

Metadata

Metadata

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions