diff options
Diffstat (limited to 'src/libutil/terminal.hh')
-rw-r--r-- | src/libutil/terminal.hh | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/libutil/terminal.hh b/src/libutil/terminal.hh index 43df5bd70..6b8d59182 100644 --- a/src/libutil/terminal.hh +++ b/src/libutil/terminal.hh @@ -9,6 +9,15 @@ namespace nix { /** * Determine whether ANSI escape sequences are appropriate for the * present output. + * + * This follows the rules described on https://bixense.com/clicolors/ + * with CLICOLOR defaulted to enabled (and thus ignored). + * + * That is to say, the following procedure is followed in order: + * - NO_COLOR or NOCOLOR set -> always disable colour + * - CLICOLOR_FORCE or FORCE_COLOR set -> enable colour + * - The output is a tty; TERM != "dumb" -> enable colour + * - Otherwise -> disable colour */ bool shouldANSI(); |