dispose method
Releases any internally-cached terminal. Call this when you're done
issuing prompts (typically at the end of your program). No-op if the
commander was constructed with an explicit terminal: argument.
Implementation
Future<void> dispose() async {
if (_disposed) return;
_disposed = true;
final t = _cachedTerminal;
_cachedTerminal = null;
if (t != null) await t.shutdown();
}