Skip to content

Commit

Permalink
Fix colors in terminal (Deducteam#1080)
Browse files Browse the repository at this point in the history
* change color of queries answers in terminal to black instead of red

* fix color of text in command line Lambdapi when Console.out is used

* fix/colors : update CHANGES.md
  • Loading branch information
Alidra authored Apr 12, 2024
1 parent d19df78 commit bd9a2d8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/).

### Added

- add export format `raw_dk`
- Add export format `raw_dk`
- Fix of the color of the text in command line when console.out is used.
- Use black text instead of red when diplaying queries answers.

## 2.5.0 (2024-02-25)

Expand Down
1 change: 1 addition & 0 deletions src/common/console.ml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ let set_default_verbose : int -> unit = fun i ->
[lvl] is strictly greater than the current verbosity level. Note that the
output channel is automatically flushed if logging modes are enabled. *)
let out : int -> 'a outfmt -> 'a = fun lvl fmt ->
Color.update_with_color Stdlib.(!out_fmt);
let out = Format.(if lvl > !verbose then ifprintf else fprintf) in
out Stdlib.(!out_fmt) (fmt ^^ "@.")

Expand Down
2 changes: 1 addition & 1 deletion src/handle/query.ml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ type result = (unit -> string) option
(** [return pp x] prints [x] using [pp] on [Stdlib.(!out_fmt)] at verbose
level 1 and returns a function for printing [x] on a string using [pp]. *)
let return : 'a pp -> 'a -> result = fun pp x ->
Console.out 1 (Color.red "%a") pp x;
Console.out 1 "%a" pp x;
Some (fun () -> Format.asprintf "%a" pp x)

(** [handle_query ss ps q] *)
Expand Down

0 comments on commit bd9a2d8

Please sign in to comment.