pub fn no_color() -> bool
Expand description
Check NO_COLOR status
When true
, should prevent the addition of ANSI color.
User-level configuration files and per-instance command-line arguments should override
NO_COLOR. A user should be able to export $NO_COLOR
in their shell configuration file as a
default, but configure a specific program in its configuration file to specifically enable
color.
Examples found in repository?
examples/query.rs (line 6)
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}