clicolor

Function clicolor 

Source
pub fn clicolor() -> Option<bool>
Expand description

Check CLICOLOR status

  • When true, ANSI colors are supported and should be used when the program isn’t piped, similar to term_supports_color
  • When false, don’t output ANSI color escape codes, similar to no_color

See also:

Examples found in repository?
examples/query.rs (line 4)
3fn main() {
4    println!("clicolor: {:?}", anstyle_query::clicolor());
5    println!("clicolor_force: {}", anstyle_query::clicolor_force());
6    println!("no_color: {}", anstyle_query::no_color());
7    println!(
8        "term_supports_ansi_color: {}",
9        anstyle_query::term_supports_ansi_color()
10    );
11    println!(
12        "term_supports_color: {}",
13        anstyle_query::term_supports_color()
14    );
15    println!("truecolor: {}", anstyle_query::truecolor());
16    println!(
17        "enable_ansi_colors: {:?}",
18        anstyle_query::windows::enable_ansi_colors()
19    );
20    #[cfg(windows)]
21    println!(
22        "  enable_virtual_terminal_processing: {:?}",
23        anstyle_query::windows::enable_virtual_terminal_processing()
24    );
25    println!("is_ci: {:?}", anstyle_query::is_ci());
26}