TerminalCapabilities class
Properties of the output stream that drive preset composition.
Three orthogonal capabilities:
- ansi: whether the stream supports ANSI escape codes (color, cursor manipulation, etc.).
- tty: whether the stream is connected to a real terminal. This distinguishes a true terminal (where decorators can rely on a stable line width) from an IDE Run Console (which typically supports ANSI but is a pipe with unknown width) or a file redirection.
- width: the detected terminal width in columns when the stream
is a TTY and the SDK can query it.
nullmeans width is unknown — usually because tty isfalse, occasionally because the underlying VM call threw.
Constructors
- TerminalCapabilities({required bool ansi, required bool tty, int? width})
-
const
Properties
- ansi → bool
-
Stream supports ANSI escape codes.
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- tty → bool
-
Stream is connected to a real terminal (TTY).
final
- width → int?
-
Stream's column count, when known.
nullotherwise.final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override