Skip to content

Commit

Permalink
Add suport for "standard" NO_COLOR env variable
Browse files Browse the repository at this point in the history
  • Loading branch information
leovilok committed Apr 5, 2020
1 parent 02c02c5 commit ef4716b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions nnn.1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions src/nnn.c
Original file line number Diff line number Diff line change
Expand Up @@ -6867,6 +6867,9 @@ int main(int argc, char *argv[])
}
}

if (getenv("NO_COLOR"))
g_states |= STATE_NOCOLOR;

#ifdef DBGMODE
enabledbg();
DPRINTF_S(VERSION);
Expand Down

0 comments on commit ef4716b

Please sign in to comment.