ReadonlyisTrue once shutdown has been requested (e.g. first Ctrl-C in long-running mode).
Enter long-running mode where the first Ctrl-C sets a cooperative flag instead of exiting, and a third Ctrl-C forces exit.
Handle a user interrupt (e.g. Ctrl-C read as a key press while the terminal is in raw mode),
with the same behavior as receiving SIGINT: outside long-running mode, run the shutdown tasks
and exit; in long-running mode, set isShutdownRequested, with a third interrupt forcing
exit.
Leave long-running mode, restoring default single Ctrl-C exit behavior.
Service allowing registration of prioritised tasks to run during CLI shutdown.