Skip to content

Colorful and stylized text in the standard output doesn't display as expected #1055

@MStoic13

Description

@MStoic13

I was trying to use the ansi_term crate to color and style the output text but instead I got this in the standard output:
�[33mThis is colored�[0m, �[1mthis is bold�[0m and �[1;33mthis is bold and colored�[0m

I see ansi_term is a crate from the Rust cookbook and Rust Playground does have it cargo.toml
https://rust-lang-nursery.github.io/rust-cookbook/cli/ansi_terminal.html?highlight=color#ansi-terminal

Here is an example in Rust Playground
https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=cbbd1a66e3da6ea8e38e1b4d3bc06bb9

Any idea how I can display colored / stylized text in the output?

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