From 5faad10451c767bfcafdf0fdd747ed6a57889f5a Mon Sep 17 00:00:00 2001 From: Piotr Oleskiewicz Date: Tue, 22 Jan 2019 17:08:24 +0000 Subject: [PATCH 1/3] mu-config: add NO_COLOR environment variable --- mu/mu-config.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mu/mu-config.c b/mu/mu-config.c index 40ff2df7..c9fc9a47 100644 --- a/mu/mu-config.c +++ b/mu/mu-config.c @@ -79,9 +79,9 @@ set_group_mu_defaults (void) MU_CONFIG.muhome = exp; } - /* check for the MU_NOCOLOR env var; but in any case don't + /* check for the MU_NOCOLOR or NO_COLOR env vars; but in any case don't * use colors unless we're writing to a tty */ - if (g_getenv (MU_NOCOLOR) != NULL) + if (g_getenv (MU_NOCOLOR) != NULL || g_getenv (NO_COLOR) != NULL) MU_CONFIG.nocolor = TRUE; if (!isatty(fileno(stdout)) || !isatty(fileno(stderr))) From c7ea01304f1e2284a695c6dd7210365f95a8c8ba Mon Sep 17 00:00:00 2001 From: Piotr Oleskiewicz Date: Mon, 28 Jan 2019 15:50:47 +0000 Subject: [PATCH 2/3] mu-config: put environmental variable in inverted commas --- mu/mu-config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mu/mu-config.c b/mu/mu-config.c index c9fc9a47..0ee2d352 100644 --- a/mu/mu-config.c +++ b/mu/mu-config.c @@ -81,7 +81,7 @@ set_group_mu_defaults (void) /* check for the MU_NOCOLOR or NO_COLOR env vars; but in any case don't * use colors unless we're writing to a tty */ - if (g_getenv (MU_NOCOLOR) != NULL || g_getenv (NO_COLOR) != NULL) + if (g_getenv (MU_NOCOLOR) != NULL || g_getenv ("NO_COLOR") != NULL) MU_CONFIG.nocolor = TRUE; if (!isatty(fileno(stdout)) || !isatty(fileno(stderr))) From 4784a7b0c922a973585e423c62c7e3190f9de18f Mon Sep 17 00:00:00 2001 From: Piotr Oleskiewicz Date: Mon, 28 Jan 2019 15:54:12 +0000 Subject: [PATCH 3/3] mu: update manpage document usage of the NO_COLOR environment variable --- man/mu-easy.1 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/man/mu-easy.1 b/man/mu-easy.1 index 12762577..4025bc1e 100644 --- a/man/mu-easy.1 +++ b/man/mu-easy.1 @@ -22,8 +22,9 @@ commands, but you won't be able to index/search your mail. By default, \fBmu\fR uses colorized output when it thinks your terminal is capable of doing so. If you don't like color, you can use -the \fB--nocolor\fR command-line option, or set the \fBMU_NOCOLOR\fR -environment variable to non-empty. +the \fB--nocolor\fR command-line option, or set either the +\fBMU_NOCOLOR\fR or the \fBNO_COLOR\fR environment variable to +non-empty. .SH INDEXING YOUR E-MAIL