From c2de0d98ba39e0a1a970d066fd19be786092f376 Mon Sep 17 00:00:00 2001 From: Michael Biebl Date: Tue, 1 Mar 2016 16:55:22 +0100 Subject: Imported Upstream version 1.1.91 --- clients/cli/utils.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'clients/cli/utils.c') diff --git a/clients/cli/utils.c b/clients/cli/utils.c index 898e7f26..d05ea285 100644 --- a/clients/cli/utils.c +++ b/clients/cli/utils.c @@ -18,18 +18,17 @@ */ /* Generated configuration file */ -#include "config.h" + +#include "nm-default.h" #include #include #include #include - #include #include #include -#include "nm-default.h" #include "utils.h" int @@ -362,8 +361,13 @@ use_colors (NmCli *nmc) if (nmc == NULL) return FALSE; - if (nmc->use_colors == NMC_USE_COLOR_AUTO) - nmc->use_colors = isatty (fileno (stdout)) ? NMC_USE_COLOR_YES : NMC_USE_COLOR_NO; + if (nmc->use_colors == NMC_USE_COLOR_AUTO) { + if ( g_strcmp0 (g_getenv ("TERM"), "dumb") == 0 + || !isatty (fileno (stdout))) + nmc->use_colors = NMC_USE_COLOR_NO; + else + nmc->use_colors = NMC_USE_COLOR_YES; + } return nmc->use_colors == NMC_USE_COLOR_YES; } -- cgit 1.3.0-6-gf8a5