documentation added for changes

This commit is contained in:
pandula12 2024-05-13 15:00:24 +09:30
parent a1591f8aaf
commit 3acc7e417c
1 changed files with 2 additions and 0 deletions

View File

@ -216,12 +216,14 @@ def _highlight(
from pygments import highlight
import pygments.util
# Terminal set to newer pygment formatters depending on user environment variables
if os.getenv("COLORTERM", "") in ("truecolor", "24bit"):
from pygments.formatters.terminal256 import TerminalTrueColorFormatter
terminal_formatter = TerminalTrueColorFormatter(style=os.getenv("PYTEST_THEME", "default"))
elif "256" in os.getenv("TERM", ""):
from pygments.formatters.terminal256 import Terminal256Formatter
terminal_formatter = Terminal256Formatter(style=os.getenv("PYTEST_THEME", "default"))
# Otherwise use the terminal formatter used previously
else:
terminal_formatter = TerminalFormatter(bg=os.getenv("PYTEST_THEME_MODE", "dark"),
style=os.getenv("PYTEST_THEME", "default"))