aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar lvgx <l@vgx.fr>2020-04-05 03:56:18 +0200
committerGravatar GitHub <noreply@github.com>2020-04-05 03:56:18 +0200
commitf14fb9c0f92c25ab79dd0c47d16f075199aeb999 (patch)
tree0814a951a1b6c9f3fc53c51b9085522cb152c2e0
parent6d13fce69851d8880f408a22f6e9bee8ff708d11 (diff)
downloadnnn-f14fb9c0f92c25ab79dd0c47d16f075199aeb999.tar.gz
Add suport for "standard" NO_COLOR env variable (#508)
See https://no-color.org
-rw-r--r--nnn.12
-rw-r--r--src/nnn.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/nnn.1 b/nnn.1
index 86c879c..b7dcf02 100644
--- a/nnn.1
+++ b/nnn.1
@@ -410,6 +410,8 @@ separated by \fI;\fR:
.Pp
\fBnnn:\fR this is a special variable set to the hovered entry before executing
a command from the command prompt or spawning a shell.
+.Pp
+\fBNO_COLOR:\fR if defined, disable ANSI color output.
.Sh KNOWN ISSUES
.Nm
may not handle keypresses correctly when used with tmux (see issue #104 for
diff --git a/src/nnn.c b/src/nnn.c
index 20f42b6..6e55389 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -1524,7 +1524,7 @@ static bool initcurses(void *oldmask)
#endif
curs_set(FALSE); /* Hide cursor */
- if (!(g_states & STATE_NOCOLOR)) {
+ if (!(g_states & STATE_NOCOLOR || getenv("NO_COLOR"))) {
start_color();
use_default_colors();