Skip to content

Commit

Permalink
Add NO_COLOR support (#89)
Browse files Browse the repository at this point in the history
* Add NO_COLOR support

* Fix clippy warning
  • Loading branch information
lambdagolem authored Feb 6, 2021
1 parent f61351b commit b3dfd17
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/unix_term.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ pub fn is_a_color_terminal(out: &Term) -> bool {
return false;
}

if env::var("NO_COLOR").is_ok() {
return false;
}

match env::var("TERM") {
Ok(term) => term != "dumb",
Err(_) => false,
Expand Down

0 comments on commit b3dfd17

Please sign in to comment.