rust-playground icon indicating copy to clipboard operation
rust-playground copied to clipboard

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

Open MStoic13 opened this issue 1 year ago • 0 comments

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?

MStoic13 avatar Apr 20 '24 22:04 MStoic13