Skip to content

Commit ad64f9c

Browse files
committed
win10 color fix #86
1 parent 0fd4d43 commit ad64f9c

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

Diff for: Cargo.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@ repository = "https://github.com/o2sh/onefetch"
99
exclude = ["assets/*.png"]
1010

1111
[dependencies]
12-
colored= "1.6.1"
12+
colored= "1.8.0"
1313
git2 = {version = "0.7.5", default-features = false}
1414
tokei = "10.0"
1515
license = "0.7.1"
1616
bytecount = "0.5.1"
1717
clap = "2.33.0"
1818
strum = "0.16.0"
1919
strum_macros = "0.16.0"
20+
ansi_term = "0.12"

Diff for: src/main.rs

+4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ extern crate colored;
33
extern crate git2;
44
extern crate license;
55
extern crate tokei;
6+
extern crate ansi_term;
67
#[macro_use]
78
extern crate clap;
89
extern crate strum;
@@ -445,6 +446,9 @@ impl fmt::Display for Language {
445446
}
446447

447448
fn main() -> Result<()> {
449+
if cfg!(windows) && !ansi_term::enable_ansi_support().is_ok() {
450+
colored::control::set_override(false);
451+
}
448452
if !is_git_installed() {
449453
return Err(Error::GitNotInstalled);
450454
}

0 commit comments

Comments
 (0)