terminate method
Terminates the connection to stdin
, closing all subscription.
Implementation
Future<void> terminate() async {
if (_sub == null) {
throw StateError('Stdin has already been terminated.');
}
await _sub?.cancel();
await _current?.close();
_sub = null;
}