Skip to content
Myr

Merge pull request #1421 from acuteenvy/fix-no-color

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

authored by Tavian Barnes · committed by GitHub · parents 8bbbd76, ad5fb44 · Browse files · 2 files+5 added−1 removed
This commit

State

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

Trailers

  • fix: display color when `NO_COLOR` is an empty string

Diff stats

2 files+5 added−1 removed

  • other:+5 added−1 removed

2 files+5 added−1 removed

modified:src/main.rs+3 added-1 removed
216 unmodified lines
217 #[cfg(not(windows))]218 let ansi_colors_support = true;219220 let interactive_terminal = std::io::stdout().is_terminal();221222 let colored_output = match opts.color {223 ColorWhen::Always => true,224 ColorWhen::Never => false,225 ColorWhen::Auto => {226 let no_color = env::var_os("NO_COLOR").is_some_and(|x| !x.is_empty());225 ansi_colors_support && env::var_os("NO_COLOR").is_none() && interactive_terminal227 ansi_colors_support && !no_color && interactive_terminal228 }229 };230231 let ls_colors = if colored_output {
244 unmodified lines
modified:CHANGELOG.md+2 added
6 unmodified lines
789## Bugfixes1011- Fix `NO_COLOR` support, see #1421 (@acuteenvy)1213## Changes1415- The default number of threads is now constrained to be at most 16. This should improve startup time on16 systems with many CPU cores. (#1203)
698 unmodified lines