From 2da36cf99a737d8cf4a145f1f5d540cbb4eb1b95 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 14 Jul 2022 15:57:43 -0600 Subject: [PATCH] [hb-view] Use envvar HB_CHAFA=0 to disable Chafa output --- util/helper-cairo-ansi.hh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/util/helper-cairo-ansi.hh b/util/helper-cairo-ansi.hh index a35e32793..a4662f373 100644 --- a/util/helper-cairo-ansi.hh +++ b/util/helper-cairo-ansi.hh @@ -195,7 +195,11 @@ helper_cairo_surface_write_to_ansi_stream (cairo_surface_t *surface, if (width && height) { #ifdef HAVE_CHAFA - if (true) + const char *env = getenv ("HB_CHAFA"); + bool chafa = true; + if (env) + chafa = atoi (env); + if (chafa) chafa_print_image_rgb24 (data, width, height, stride); else #endif