hasTerminal 属性

布尔型 hasTerminal

stdin 是否已连接终端。

实现

bool get hasTerminal {
  try {
    return stdioType(this) == StdioType.terminal;
  } on FileSystemException catch (_) {
    // If stdioType throws a FileSystemException, then it is not hooked up to
    // a terminal, probably because it is closed, but let other exception
    // types bubble up.
    return false;
  }
}