diff --git a/src/run.rs b/src/run.rs index 06847666..35aa65a6 100644 --- a/src/run.rs +++ b/src/run.rs @@ -2,10 +2,13 @@ use common::*; use std::{convert, ffi, cmp}; use clap::{App, Arg, ArgGroup, AppSettings}; -use misc::maybe_s; use configuration::DEFAULT_SHELL; +use misc::maybe_s; use unicode_width::UnicodeWidthStr; +#[cfg(windows)] +use ansi_term::enable_ansi_support; + macro_rules! die { ($($arg:tt)*) => {{ extern crate std; @@ -132,6 +135,11 @@ pub fn run() { other => die!("Invalid argument `{}` to --color. This is a bug in just.", other), }; + if color.active() { + #[cfg(windows)] + enable_ansi_support().ok(); + } + let set_count = matches.occurrences_of("SET"); let mut overrides = Map::new(); if set_count > 0 {