From dbf1f8200c6d5d3ddb61aa093376cb78156980e1 Mon Sep 17 00:00:00 2001 From: Hugo Herbelin Date: Wed, 5 Jul 2017 22:52:09 +0200 Subject: Adding support for bindings tags to explicit prefix/suffix rather than colors. This is usable for no-color terminal. For instance, a typical application in mind is the Coq-generate names marker which can be rendered with a color if the interface supports it and a prefix "~" if the interface does not support colors. --- toplevel/coqtop.ml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'toplevel') diff --git a/toplevel/coqtop.ml b/toplevel/coqtop.ml index 8c394316e..08c235023 100644 --- a/toplevel/coqtop.ml +++ b/toplevel/coqtop.ml @@ -58,16 +58,18 @@ let init_color () = match colors with | None -> (** Default colors *) - Topfmt.init_color_output () + 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_color_output () + Topfmt.init_terminal_output ~color:true end + else + Topfmt.init_terminal_output ~color:false let toploop_init = ref begin fun x -> let () = init_color () in -- cgit v1.2.3