From 26ecde20b9d532d70ce12ac68bc9bf2f033f97a7 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Fri, 25 Aug 2023 14:11:34 +1000 Subject: [PATCH] pw-mon: check stdout, not stderr for tty Commit afc88a12e511 changed pw-mon to use printf so we now need to check stdout to know whether we need to print with colors. --- src/tools/pw-mon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/pw-mon.c b/src/tools/pw-mon.c index 7e8604ec9..f65454502 100644 --- a/src/tools/pw-mon.c +++ b/src/tools/pw-mon.c @@ -757,7 +757,7 @@ int main(int argc, char *argv[]) setlinebuf(stdout); - if (isatty(STDERR_FILENO) && getenv("NO_COLOR") == NULL) + if (isatty(STDOUT_FILENO) && getenv("NO_COLOR") == NULL) colors = true; while ((c = getopt_long(argc, argv, "hVr:NC", long_options, NULL)) != -1) {