mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix ANSI control sequence support detection (#11708)
This commit is contained in:
parent
23c9cb4e78
commit
a8d580075e
@ -47,6 +47,9 @@ Bugs fixed
|
|||||||
package (triggered if using ``fontenc`` with ``T2A`` option and document
|
package (triggered if using ``fontenc`` with ``T2A`` option and document
|
||||||
language is not a Cyrillic one).
|
language is not a Cyrillic one).
|
||||||
Patch by Jean-François B.
|
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
|
Testing
|
||||||
-------
|
-------
|
||||||
|
@ -5,7 +5,7 @@ from typing import Any, Callable, TypeVar
|
|||||||
|
|
||||||
from sphinx.locale import __
|
from sphinx.locale import __
|
||||||
from sphinx.util import logging
|
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:
|
if False:
|
||||||
from collections.abc import Iterable, Iterator
|
from collections.abc import Iterable, Iterator
|
||||||
@ -33,7 +33,8 @@ def status_iterator(
|
|||||||
verbosity: int = 0,
|
verbosity: int = 0,
|
||||||
stringify_func: Callable[[Any], str] = display_chunk,
|
stringify_func: Callable[[Any], str] = display_chunk,
|
||||||
) -> Iterator[T]:
|
) -> 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)
|
bold_summary = bold(summary)
|
||||||
if length == 0:
|
if length == 0:
|
||||||
logger.info(bold_summary, nonl=True)
|
logger.info(bold_summary, nonl=True)
|
||||||
|
Loading…
Reference in New Issue
Block a user