Skip to content

Commit 589dc00

Browse files
committed
text
1 parent 8cd7450 commit 589dc00

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

docs/source/console.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -405,10 +405,12 @@ If Rich detects that it is not writing to a terminal it will strip control codes
405405

406406
Letting Rich auto-detect terminals is useful as it will write plain text when you pipe output to a file or other application.
407407

408+
.. _interactive_mode:
409+
408410
Interactive mode
409411
----------------
410412

411-
Rich will remove animations such as progress bars and status indicators when not writing to a terminal as you probably don't want to write these out to a text file (for example). You can override this behavior by setting the ``force_interactive`` argument on the constructor. Set it to True to enable animations or False to disable them.
413+
Rich will remove animations such as progress bars and status indicators when not writing to a terminal as you probably don't want to write these out to a text file (for example). You can override this behavior by setting the ``force_interactive`` argument on the constructor. Set it to ``True`` to enable animations or ``False`` to disable them.
412414

413415

414416
Environment variables
@@ -427,10 +429,11 @@ If the environment variable ``NO_COLOR`` is set, Rich will disable all color in
427429

428430
The environment variable ``TTY_COMPATIBLE`` is used to override Rich's auto-detection of terminal support. If ``TTY_COMPATIBLE`` is set to ``1`` then Rich will assume it is writing to a device which can handle escape sequences like a terminal. If ``TTY_COMPATIBLE`` is set to ``"0"``, then Rich will assume that it is writing to a device that is *not* capable of displaying escape sequences (such as a regular file). If the variable is not set, or set to a value other than "0" or "1", then Rich will attempt to auto-detect terminal support.
429431

430-
The environment variable ``TTY_INTERACTIVE`` is used to override Rich's auto-detection of interactive mode (see above). If you set this to ``"0"``, it will disable interactive mode even if Rich thinks it is writing to a terminal. Set this to ``"1"`` to force interactive mode on. If this environment variable is not set, or set to any other value, then interactive mode will be auto-detected as normal.
432+
The environment variable ``TTY_INTERACTIVE`` is used to override Rich's auto-detection of :ref:`interactive_mode`. If you set this to ``"0"``, it will disable interactive mode even if Rich thinks it is writing to a terminal. Set this to ``"1"`` to force interactive mode on. If this environment variable is not set, or set to any other value, then interactive mode will be auto-detected as normal.
431433

432434
.. note::
433-
If you want Rich output in CI or Github Actions, then you should set ``TTY_COMPATIBLE=1`` and ``TTY_INTERACTIVE=0``.
435+
If you want Rich output in CI or Github Actions, then you should set ``TTY_COMPATIBLE=1`` and ``TTY_INTERACTIVE=0``. The combination of both these variables tells rich that it can output escape sequences,
436+
and also that there is no user interacting with the terminal -- so it won't bother animating progress bars.
434437

435438
If ``width`` / ``height`` arguments are not explicitly provided as arguments to ``Console`` then the environment variables ``COLUMNS`` / ``LINES`` can be used to set the console width / height. ``JUPYTER_COLUMNS`` / ``JUPYTER_LINES`` behave similarly and are used in Jupyter.
436439

0 commit comments

Comments
 (0)