pw-mon: check stdout, not stderr for tty

Commit afc88a12e5 changed pw-mon to use printf so we now need to check
stdout to know whether we need to print with colors.
This commit is contained in:
Peter Hutterer 2023-08-25 14:11:34 +10:00 committed by Wim Taymans
parent 001c6e1cc1
commit 26ecde20b9

View file

@ -757,7 +757,7 @@ int main(int argc, char *argv[])
setlinebuf(stdout); setlinebuf(stdout);
if (isatty(STDERR_FILENO) && getenv("NO_COLOR") == NULL) if (isatty(STDOUT_FILENO) && getenv("NO_COLOR") == NULL)
colors = true; colors = true;
while ((c = getopt_long(argc, argv, "hVr:NC", long_options, NULL)) != -1) { while ((c = getopt_long(argc, argv, "hVr:NC", long_options, NULL)) != -1) {