Skip to content

textual.constants

This module contains constants, which may be set in environment variables.

COLOR_SYSTEM module-attribute

COLOR_SYSTEM = get_environ('TEXTUAL_COLOR_SYSTEM', 'auto')

Force color system override.

DEBUG module-attribute

DEBUG = _get_environ_bool('TEXTUAL_DEBUG')

Enable debug mode.

DEVTOOLS_HOST module-attribute

DEVTOOLS_HOST = get_environ(
    "TEXTUAL_DEVTOOLS_HOST", "127.0.0.1"
)

The host where textual console is running.

DEVTOOLS_PORT module-attribute

DEVTOOLS_PORT = _get_environ_int(
    "TEXTUAL_DEVTOOLS_PORT", 8081
)

Constant with the port that the devtools will connect to.

DRIVER module-attribute

DRIVER = get_environ('TEXTUAL_DRIVER', None)

Import for replacement driver.

ESCAPE_DELAY module-attribute

ESCAPE_DELAY = _get_environ_int('ESCDELAY', 100) / 1000.0

The delay (in seconds) before reporting an escape key (not used if the extend key protocol is available).

FILTERS module-attribute

FILTERS = get_environ('TEXTUAL_FILTERS', '')

A list of filters to apply to renderables.

LOG_FILE module-attribute

LOG_FILE = get_environ('TEXTUAL_LOG', None)

A last resort log file that appends all logs, when devtools isn't working.

MAX_FPS module-attribute

MAX_FPS = _get_environ_int('TEXTUAL_FPS', 60)

Maximum frames per second for updates.

PRESS module-attribute

PRESS = get_environ('TEXTUAL_PRESS', '')

Keys to automatically press.

SCREENSHOT_DELAY module-attribute

SCREENSHOT_DELAY = _get_environ_int(
    "TEXTUAL_SCREENSHOT", -1
)

Seconds delay before taking screenshot.

SCREENSHOT_FILENAME module-attribute

SCREENSHOT_FILENAME = get_environ(
    "TEXTUAL_SCREENSHOT_FILENAME"
)

The filename to use for the screenshot.

SCREENSHOT_LOCATION module-attribute

SCREENSHOT_LOCATION = get_environ(
    "TEXTUAL_SCREENSHOT_LOCATION"
)

The location where screenshots should be written.

SHOW_RETURN module-attribute

SHOW_RETURN = _get_environ_bool('TEXTUAL_SHOW_RETURN')

Write the return value on exit.

SLOW_THRESHOLD module-attribute

SLOW_THRESHOLD = _get_environ_int(
    "TEXTUAL_SLOW_THRESHOLD", 500
)

The time threshold (in milliseconds) after which a warning is logged if message processing exceeds this duration.

TEXTUAL_ANIMATIONS module-attribute

TEXTUAL_ANIMATIONS = _get_textual_animations()

Determines whether animations run or not.