From c1398145f31a68dfd301d74c6b1342258fb3f45a Mon Sep 17 00:00:00 2001 From: Jonathan Turner Date: Thu, 16 May 2019 21:37:18 -0700 Subject: [PATCH] Add windows cfg check --- src/main.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 7d937ac28a..57036b283e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -48,7 +48,11 @@ fn main() -> Result<(), Box> { let config = Config::builder().color_mode(ColorMode::Forced).build(); let h = crate::shell::Helper::new(); let mut rl: Editor = Editor::with_config(config); - let _ = ansi_term::enable_ansi_support(); + + if cfg!(windows) { + let _ = ansi_term::enable_ansi_support(); + } + rl.set_helper(Some(h)); if rl.load_history("history.txt").is_err() { println!("No previous history.");