Skip to content
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
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ Bugs fixed
package (triggered if using ``fontenc`` with ``T2A`` option and document
language is not a Cyrillic one).
Patch by Jean-François B.
* #11675: Fix rendering of progression bars in environments that do not support
ANSI control sequences.
Patch by Bénédikt Tran.

Testing
-------
Expand Down
5 changes: 3 additions & 2 deletions sphinx/util/display.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from sphinx.locale import __
from sphinx.util import logging
from sphinx.util.console import bold # type: ignore[attr-defined]
from sphinx.util.console import bold, color_terminal # type: ignore[attr-defined]

if False:
from collections.abc import Iterable, Iterator
Expand Down Expand Up @@ -33,7 +33,8 @@ def status_iterator(
verbosity: int = 0,
stringify_func: Callable[[Any], str] = display_chunk,
) -> Iterator[T]:
single_line = verbosity < 1
# printing on a single line requires ANSI control sequences
single_line = verbosity < 1 and color_terminal()
bold_summary = bold(summary)
if length == 0:
logger.info(bold_summary, nonl=True)
Expand Down