From 5b66cfdae503a10b724c111f35ceb001a705a95d Mon Sep 17 00:00:00 2001 From: Pierre Courtieu Date: Mon, 18 May 2015 15:45:07 +0200 Subject: Disabling colors when tERM variable is "dumb". This disables colors in emacs compilation buffer, which does not support ansi colors by default. --- toplevel/coqtop.ml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/toplevel/coqtop.ml b/toplevel/coqtop.ml index af7169ad6c..7ba0c55a15 100644 --- a/toplevel/coqtop.ml +++ b/toplevel/coqtop.ml @@ -58,7 +58,10 @@ let init_color () = | `ON -> true | `AUTO -> Terminal.has_style Unix.stdout && - Terminal.has_style Unix.stderr + Terminal.has_style Unix.stderr && + (* emacs compilation buffer does not support colors by default, + its TERM variable is set to "dumb". *) + Unix.getenv "TERM" <> "dumb" in if has_color then begin let colors = try Some (Sys.getenv "COQ_COLORS") with Not_found -> None in -- cgit v1.2.3