]> Sergey Matveev's repositories - nnn.git/commitdiff
Add suport for "standard" NO_COLOR env variable (#508)
authorlvgx <l@vgx.fr>
Sun, 5 Apr 2020 01:56:18 +0000 (03:56 +0200)
committerGitHub <noreply@github.com>
Sun, 5 Apr 2020 01:56:18 +0000 (03:56 +0200)
See https://no-color.org

nnn.1
src/nnn.c

diff --git a/nnn.1 b/nnn.1
index 86c879cba342945dcc48d3f57ab063800715a903..b7dcf02cac055766de6d567e1e600e4895fe79c1 100644 (file)
--- 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
index 20f42b69436e939fc3fef5d049a372db47297146..6e553894c8b8097b299258cee3737fc1674600b9 100644 (file)
--- 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();