dispose method

Future<void> dispose()

Restores the terminal and stops reading input.

Implementation

Future<void> dispose() async {
  if (interactive) {
    write('\x1B[?2004l\x1B[?25h');
    try {
      stdin
        ..lineMode = true
        ..echoMode = true;
    } on StdinException {
      // The terminal is already gone.
    }
  }
  await _interrupts?.cancel();
  await _input?.cancel();
}