Skip to content

Commit

Permalink
feat: support FORCE_COLOR (#524)
Browse files Browse the repository at this point in the history
Co-authored-by: Diego Ramirez <dr01191115@gmail.com>
  • Loading branch information
henryiii and DiddiLeija committed Dec 23, 2021
1 parent 8b1513f commit c4376af
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion docs/usage.rst
Expand Up @@ -329,7 +329,8 @@ Controlling color output
By default, Nox will output colorful logs if you're using in an interactive
terminal. However, if you are redirecting ``stderr`` to a file or otherwise
not using an interactive terminal, or the environment variable ``NO_COLOR`` is
set, nox will output in plaintext.
set, nox will output in plaintext. If this is not set, and ``FORCE_COLOR`` is
present, color will be forced.

You can manually control Nox's output using the ``--nocolor`` and ``--forcecolor`` flags.

Expand Down
2 changes: 1 addition & 1 deletion nox/_options.py
Expand Up @@ -463,7 +463,7 @@ def _session_completer(
"--forcecolor",
"--force-color",
group=options.groups["reporting"],
default=False,
default=lambda: "FORCE_COLOR" in os.environ,
action="store_true",
help="Force color output, even if stdout is not an interactive terminal.",
),
Expand Down

0 comments on commit c4376af

Please sign in to comment.