Skip to content

Commit f14fb9c

Browse files
authored
Add suport for "standard" NO_COLOR env variable (#508)
See https://no-color.org
1 parent 6d13fce commit f14fb9c

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

nnn.1

+2
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,8 @@ separated by \fI;\fR:
410410
.Pp
411411
\fBnnn:\fR this is a special variable set to the hovered entry before executing
412412
a command from the command prompt or spawning a shell.
413+
.Pp
414+
\fBNO_COLOR:\fR if defined, disable ANSI color output.
413415
.Sh KNOWN ISSUES
414416
.Nm
415417
may not handle keypresses correctly when used with tmux (see issue #104 for

src/nnn.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1524,7 +1524,7 @@ static bool initcurses(void *oldmask)
15241524
#endif
15251525
curs_set(FALSE); /* Hide cursor */
15261526

1527-
if (!(g_states & STATE_NOCOLOR)) {
1527+
if (!(g_states & STATE_NOCOLOR || getenv("NO_COLOR"))) {
15281528
start_color();
15291529
use_default_colors();
15301530

0 commit comments

Comments
 (0)