Skip to content
Myr

Windows: Check for xterm-256color environment variable as a proxy for color support

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by sharkdp · committed by David Peter · parent 53c338d · Browse files · 1 file+2 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+2 added−2 removed

  • other:+2 added−2 removed

1 file+2 added−2 removed

modified:src/main.rs+2 added-2 removed
146 unmodified lines
147 // if the pattern has an uppercase character (smart case).148 let case_sensitive = !matches.is_present("ignore-case")149 && (matches.is_present("case-sensitive") || pattern_has_uppercase_char(&pattern_regex));150151151 #[cfg(windows)]153 let ansi_colors_support = ansi_term::enable_ansi_support().is_ok();152 let ansi_colors_support =153 ansi_term::enable_ansi_support().is_ok() || std::env::var_os("TERM").is_some();154155 #[cfg(not(windows))]156 let ansi_colors_support = true;157
274 unmodified lines