diff options
author | Pierre Courtieu <Pierre.Courtieu@cnam.fr> | 2015-05-18 15:45:07 +0200 |
---|---|---|
committer | Pierre Courtieu <Pierre.Courtieu@cnam.fr> | 2015-05-18 15:45:25 +0200 |
commit | 5b66cfdae503a10b724c111f35ceb001a705a95d (patch) | |
tree | c22e78edc3b8b60c8366fc94cd4d29a4edc3f0f2 /toplevel | |
parent | 22eb2d34f0a9249720a30c6cb2973993e97834ea (diff) |
Disabling colors when tERM variable is "dumb".
This disables colors in emacs compilation buffer, which does not
support ansi colors by default.
Diffstat (limited to 'toplevel')
-rw-r--r-- | toplevel/coqtop.ml | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/toplevel/coqtop.ml b/toplevel/coqtop.ml index af7169ad6..7ba0c55a1 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 |