defaultTerminalAttributesFactory function

TerminalAttributes defaultTerminalAttributesFactory(
  1. StringSink sink
)

A default TerminalAttributesFactory that will determine the proper terminal attributes if the sink is indeed a terminal, otherwise it uses the defaults in FixedTerminalAttributes.defaults.

Implementation

TerminalAttributes defaultTerminalAttributesFactory(StringSink sink) {
  if (sink is Stdout) {
    return _StdoutTerminalAttributes(sink);
  } else {
    return FixedTerminalAttributes.defaults;
  }
}