oct
Loading...
Searching...
No Matches
terminal Namespace Reference

Functions

bool supports_ansi ()
bool supports_ansi_on (TextIO stream)

Variables

str CYAN = "\033[96m"
str GREEN = "\033[92m"
str RED = "\033[91m"
str YELLOW = "\033[93m"
str RESET = "\033[0m"

Detailed Description

Purpose
-------
Provide shared terminal color support for OCT CLI output.

Responsibilities
----------------
- Detect ANSI escape code support (including Windows VT mode).
- Export color constants used by linter, health, and formatter modules.

Diagnostics
-----------
Domain: OCT-CORE
Levels:
    L2 - (none) detection runs at import, before diagnostics are active
    L3 - (none) the colour constants are resolved at import
    L4 - (none) the Windows VT probe likewise runs at import

Contracts
---------
- Color constants are empty strings when ANSI is not supported.
- Safe to import at module level; no side effects beyond detection.

Dependencies
------------
- oct.core.diagnostics (_dbg structured logger; imported but never called, as detection runs at import before init)

Function Documentation

◆ supports_ansi()

bool terminal.supports_ansi ( )
Return True if the terminal supports ANSI escape codes.

Definition at line 41 of file terminal.py.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ supports_ansi_on()

bool terminal.supports_ansi_on ( TextIO stream)
Return True if *stream* supports ANSI escape codes.

Definition at line 46 of file terminal.py.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ CYAN

str terminal.CYAN = "\033[96m"

Definition at line 70 of file terminal.py.

◆ GREEN

str terminal.GREEN = "\033[92m"

Definition at line 71 of file terminal.py.

◆ RED

str terminal.RED = "\033[91m"

Definition at line 72 of file terminal.py.

◆ RESET

str terminal.RESET = "\033[0m"

Definition at line 74 of file terminal.py.

◆ YELLOW

str terminal.YELLOW = "\033[93m"

Definition at line 73 of file terminal.py.