From daf5ced4989d59b7fbd444f1c9fcd6a4f5f5ef0e Mon Sep 17 00:00:00 2001 From: sharkdp Date: Thu, 15 Oct 2020 21:35:25 +0200 Subject: [PATCH] Keep output colorized for 'full' and 'color' style fixes #332 --- CHANGELOG.md | 3 +++ src/main.rs | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3041b5c..aaef12f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,9 @@ - The `plot_parametrized.py` script now infers the parameter name, and its `--parameter-name` argument has been deprecated. See #253, #318. ## Bugfixes + +- Keep output colorized when the output is not interactive and `--style=full` or `--style=color` is used. + ## Other ## Packaging diff --git a/src/main.rs b/src/main.rs index f4c0b68..f731ca9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -159,7 +159,8 @@ fn build_hyperfine_options(matches: &ArgMatches<'_>) -> Result { colored::control::set_override(false) } - _ => {} + OutputStyleOption::Full | OutputStyleOption::Color => colored::control::set_override(true), + OutputStyleOption::Disabled => {} }; options.shell = matches