|
Option C Tools
|
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" |
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.
| bool terminal.supports_ansi | ( | ) |
Return True if the terminal supports ANSI escape codes.
Definition at line 33 of file terminal.py.
| bool terminal.supports_ansi_on | ( | stream | ) |
Return True if *stream* supports ANSI escape codes.
Definition at line 38 of file terminal.py.
| str terminal.CYAN = "\033[96m" |
Definition at line 62 of file terminal.py.
| str terminal.GREEN = "\033[92m" |
Definition at line 63 of file terminal.py.
| str terminal.RED = "\033[91m" |
Definition at line 64 of file terminal.py.
| str terminal.RESET = "\033[0m" |
Definition at line 66 of file terminal.py.
| str terminal.YELLOW = "\033[93m" |
Definition at line 65 of file terminal.py.