Skip to content

TtyStyle

Category: Terminal

Source: tty_style.dart

TTY/NO_COLOR-aware adapter on top of Styled. Use for any CLI output the user might pipe (grep, redirect, capture) — falls back to plain text when stdout is not a terminal or NO_COLOR is set.

Terminal-rendering code (markdown renderer, TUI components) should keep using the raw .styled API; it always wants ANSI because it's writing directly to a real terminal screen.

Functions

bool stdoutSupportsAnsi()

true when stdout is a real terminal and the user has not opted out via NO_COLOR (https://no-color.org/).

Released under the MIT License.