From 593bd4c1c1974a429b1f42650ad73a835dfe06fc Mon Sep 17 00:00:00 2001 From: Jeremie Dimino Date: Thu, 23 Feb 2017 09:59:22 +0000 Subject: [PATCH] Disable colors when compiling from emacs --- src/future.ml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/future.ml b/src/future.ml index c843656d..bcd0b049 100644 --- a/src/future.ml +++ b/src/future.ml @@ -215,11 +215,17 @@ module Scheduler = struct let err_is_atty = lazy Unix.(isatty stderr) + let dumb_term = + match Sys.getenv "TERM" with + | exception Not_found -> true + | "dumb" -> true + | _ -> false + let command_line ?colorize { prog; args; dir; stdout_to; _ } = let colorize = match colorize with | Some x -> x - | None -> not Sys.win32 && Lazy.force err_is_atty + | None -> not Sys.win32 && Lazy.force err_is_atty && not dumb_term in let prog = let s = quote prog in