Skip to content

gh-112730: Update docs for colour env vars #112837

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Doc/using/cmdline.rst
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,9 @@ Miscellaneous options
.. versionadded:: 3.13
The ``-X presite`` option.

Controlling Color
.. _using-on-controlling-color:

Controlling color
~~~~~~~~~~~~~~~~~

The Python interpreter is configured by default to use colors to highlight
Expand Down Expand Up @@ -1135,6 +1137,7 @@ conflict.

If this variable is set to ``1``, the interpreter will colorize various kinds
of output. Setting it to ``0`` deactivates this behavior.
See also :ref:`using-on-controlling-color`.

.. versionadded:: 3.13

Expand Down
3 changes: 2 additions & 1 deletion Doc/whatsnew/3.13.rst
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ Improved Error Messages
* The interpreter now colorizes error messages when displaying tracebacks by default.
This feature can be controlled via the new :envvar:`PYTHON_COLORS` environment
variable as well as the canonical ``NO_COLOR`` and ``FORCE_COLOR`` environment
variables. (Contributed by Pablo Galindo Salgado in :gh:`112730`.)
variables. See also :ref:`using-on-controlling-color`.
(Contributed by Pablo Galindo Salgado in :gh:`112730`.)

Other Language Changes
======================
Expand Down
3 changes: 3 additions & 0 deletions Misc/python.man
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,9 @@ show how long each import takes. This is exactly equivalent to setting
.IP PYTHONBREAKPOINT
If this environment variable is set to 0, it disables the default debugger. It
can be set to the callable of your debugger of choice.
.IP PYTHON_COLORS
If this variable is set to 1, the interpreter will colorize various kinds of
output. Setting it to 0 deactivates this behavior.
.SS Debug-mode variables
Setting these variables only has an effect in a debug build of Python, that is,
if Python was configured with the
Expand Down