Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix colors in terminal #1080

Merged
merged 3 commits into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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