mikaelmello / inquire

A Rust library for building interactive prompts
https://docs.rs/inquire
MIT License
1.93k stars 76 forks source link

inquire now strips ANSI escape codes making colorised text inside prompts impossible #248

Closed leoetlino closed 5 months ago

leoetlino commented 5 months ago

A recent commit (possibly https://github.com/mikaelmello/inquire/commit/8e515d1f046561e48a2359d028d5b520cb5b6476#diff-546b6385118f60f64674170f786acf59f0ccce53d5d6ad4400409fc8363cfce1R74) has made it so that ANSI escape codes are now stripped. This makes it impossible to have colorised text inside prompt messages, e.g. if you use Confirm with a string that contains color text the color won't show up. This is a regression as this was possible with older versions (at least with 0.5.0).

mikaelmello commented 5 months ago

Thanks a lot. This shouldn't have happened :)

I've added a test to properly catch this scenario and ensure it doesn't happen again