code: function getTTYStream(stream: UnderlyingStream): ?tty.WriteStream {
    if (
      stream instanceof tty.WriteStream &&
      stream.isTTY &&
      stream.columns >= 1
    ) {
      return stream;
    }
    return null;
  }
docs: Get the stream as a TTY if it effectively looks like a valid TTY.