Currently there’re many choices for terminal text colors:
libterm(in rustc tree, used by
coloredby mackwic (used by
synas dev-dependency and
assert_cli) (Thanks to dtolnay pointing this out.)
termcolorby BurntSushi (used by ripgrep and many crates)
termby Stebalien (API same as libterm, used by rustfmt, clippy and quite a few other crates)
ansi_termby ogham (used by clap, exa and quite a few crates)
rustc_termwhich is also an export of in-tree libterm.
- and some others.
As an example,
rustfmt directly depends on
term but also pulls in
ansi_term from dependencies. It works, but i think maybe we can do better?
ansi_term has gained windows console support since 0.11 (March 2018).