enable ansi_support in windows
@@ -522,10 +522,19 @@ arg_enum! {
}
impl Pretty {
+ #[cfg(not(windows))]
pub fn color(self) -> bool {
matches!(self, Pretty::colors | Pretty::all)
}
+ #[cfg(windows)]
+ pub fn color(self) -> bool {
+ match self {
+ Pretty::colors | Pretty::all => ansi_term::enable_ansi_support().is_ok(),
+ _ => false
+ }
+ }
+
pub fn format(self) -> bool {
matches!(self, Pretty::format | Pretty::all)
}
