aboutsummaryrefslogtreecommitdiffhomepage
path: root/toplevel
diff options
context:
space:
mode:
authorGravatar Thomas Hebb <tommyhebb@gmail.com>2018-03-07 13:47:57 -0500
committerGravatar Thomas Hebb <tommyhebb@gmail.com>2018-03-07 13:53:04 -0500
commit296fd47808c5642903a81bf6a87bf291ae15abfd (patch)
tree1fe8a0e78cf5de7b826cfa2f584e224bfe94f147 /toplevel
parent144517d764f11b8b79e8f7adfeca0d075dd4ac19 (diff)
[toplevel] Respect COQ_COLORS environment variable
Since 3fc02bb2034a ("[pp] Move terminal-specific tagging to the toplevel."), the COQ_COLORS environment variable has been ignored, since init_terminal_output unconditionally called init_tag_map with the default colors, overwriting any custom colors that had been previously set. Fix this by creating a separate function, default_styles, to set the default colors. Also, remove the clear_styles function, as it was only called in one place and did nothing (since tag_map is empty to begin with).
Diffstat (limited to 'toplevel')
-rw-r--r--toplevel/coqtop.ml2
1 files changed, 1 insertions, 1 deletions
diff --git a/toplevel/coqtop.ml b/toplevel/coqtop.ml
index 341888d09..cd831c05c 100644
--- a/toplevel/coqtop.ml
+++ b/toplevel/coqtop.ml
@@ -344,13 +344,13 @@ let init_color color_mode =
match colors with
| None ->
(** Default colors *)
+ Topfmt.default_styles ();
Topfmt.init_terminal_output ~color:true
| Some "" ->
(** No color output *)
Topfmt.init_terminal_output ~color:false
| Some s ->
(** Overwrite all colors *)
- Topfmt.clear_styles ();
Topfmt.parse_color_config s;
Topfmt.init_terminal_output ~color:true
end