Option C Tools
Loading...
Searching...
No Matches
terminal Namespace Reference

Functions

bool supports_ansi ()
bool supports_ansi_on (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 — terminal capability detection
    L3 — color constant resolution
    L4 — Windows VT mode probing

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

Function Documentation

◆ supports_ansi()

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

Definition at line 33 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 ( stream)
Return True if *stream* supports ANSI escape codes.

Definition at line 38 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 62 of file terminal.py.

◆ GREEN

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

Definition at line 63 of file terminal.py.

◆ RED

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

Definition at line 64 of file terminal.py.

◆ RESET

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

Definition at line 66 of file terminal.py.

◆ YELLOW

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

Definition at line 65 of file terminal.py.