Skip to content

Support stripping of dangerous ANSI codes #298

@konstin

Description

@konstin

anstream currently has two modes: Printing all ANSI sequences, and stripping all ANSI sequences (StripStream). Would it be possible to add a third mode SanitizeStream, that allows color and similar text formatting streams, but strips potentially dangerous actions such as setting the terminal title?

This request is due to tokio-rs/tracing#3378, where tracing now allows either escaping ANSI (not stripping, leading to bad output with strange characters), or turning off this validation completely. Does this fit in the scope of anstyle?

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