W3cubDocs

/Dart 2

hasTerminal property

bool hasTerminal

Returns true if there is a terminal attached to stdin.

Implementation

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;
  }
}

© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dartlang.org/stable/2.0.0/dart-io/Stdin/hasTerminal.html