From 76327fdf01d1ff125869fe5a697d0520b2a37e3e Mon Sep 17 00:00:00 2001 From: Andrew Wood Date: Tue, 17 Dec 2024 22:47:41 +0000 Subject: [PATCH] Only set format_uses_colour if colour is permitted for this display (i.e. the display is for a terminal and not a process or window title). --- src/pv/format/sgr.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pv/format/sgr.c b/src/pv/format/sgr.c index ffea78f..35cf1e6 100644 --- a/src/pv/format/sgr.c +++ b/src/pv/format/sgr.c @@ -104,10 +104,11 @@ size_t pv_formatter_sgr(pvformatter_args_t args) /* flawfinder - null-terminated and bounded with pv_snprintf(). */ - args->display->format_uses_colour = true; - if (!args->display->colour_permitted) return 0; + + args->display->format_uses_colour = true; + if (!args->state->control.can_display_colour) return 0; if (NULL == args->segment->string_parameter)