Skip to content

Allow ANSI color codes #3378

@konstin

Description

@konstin

Feature Request

#3368 starts escaping ANSI control sequences to avoid actions such as setting the titlebar and screen clearing. To do so, it escapes all ANSI control sequences.

The change in #3368 has led to users confused about why there are escape sequences in their output (astral-sh/uv#15840).

Would it be possible to only escape (or better, strip) non-color control sequences? Color codes are purely decorative, unlike other control characters. This would allow us to continue logging color-adorned messages in CLI logs.

This feature request has the same motivation but a different specific request than #3369.

Crates

tracing-subscriber

Alternatives

If it it not possible to filter for specific ANSI escapes, would it be possible to strip ANSI escapes instead of escaping them, and to add an option to allow us to perform our own filtering? We're already using anstream as output stream to strip ANSI sequences for non-color targets, we can extend this to perform the filtering for dangerous codes ourselves.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions