interruptSignals property

  1. @override
Stream<void> get interruptSignals
override

Emits an event when the user requests an interrupt (Ctrl+C / SIGINT).

On most platforms a Ctrl+C in raw mode is delivered as a process signal rather than an input byte, and the default action terminates the process before the terminal can be restored. While a component is listening to this stream the default termination is suppressed, so the component can restore the terminal and abort gracefully.

Implementation

@override
Stream<void> get interruptSignals =>
    _interruptSignals ??= ProcessSignal.sigint.watch().map((final _) {});