close method

Future<void> close()

Stops reading and restores the terminal modes. Safe to call more than once.

Implementation

Future<void> close() async {
  if (_closed) return;
  _closed = true;
  await _sub?.cancel();
  if (interactive) _setRawMode?.call(false);
}