ansiOutputEnabled top-level property

bool get ansiOutputEnabled

Whether formatted ANSI output is enabled for wrapWith and AnsiCode.wrap.

By default, returns true if both stdout.supportsAnsiEscapes and stderr.supportsAnsiEscapes from dart:io are true.

The default can be overridden by setting the Zone variable AnsiCode to either true or false.

overrideAnsiOutput is provided to make this easy.

Implementation

bool get ansiOutputEnabled =>
    Zone.current[AnsiCode] as bool? ??
    (io.stdout.supportsAnsiEscapes && io.stderr.supportsAnsiEscapes);