File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -612,6 +612,26 @@ Miscellaneous options
612612 .. versionadded :: 3.13
613613 The ``-X presite `` option.
614614
615+ Controlling Color
616+ ~~~~~~~~~~~~~~~~~
617+
618+ The Python interpreter is configured by default to use colors to highlight
619+ output in certain situations such as when displaying tracebacks. This
620+ behavior can be controlled by setting different environment variables.
621+
622+ Setting the environment variable ``TERM `` to ``dumb `` will disable color.
623+
624+ If the environment variable ``FORCE_COLOR `` is set, then color will be
625+ enabled regardless of the value of TERM. This is useful on CI systems which
626+ aren’t terminals but can none-the-less display ANSI escape sequences.
627+
628+ If the environment variable ``NO_COLOR `` is set, Python will disable all color
629+ in the output. This takes precedence over ``FORCE_COLOR ``.
630+
631+ All these environment variables are used also by other tools to control color
632+ output. To control the color output only in the Python interpreter, the
633+ :envvar: `PY_COLORS ` environment variable can be used. This variable takes
634+ less precedence than ``NO_COLOR `` and ``FORCE_COLOR ``.
615635
616636Options you shouldn't use
617637~~~~~~~~~~~~~~~~~~~~~~~~~
You can’t perform that action at this time.
0 commit comments