Skip to content

Instantly share code, notes, and snippets.

@dck-jp
Created August 30, 2021 07:33
Show Gist options
  • Save dck-jp/3c978b4217f5b4aef5ece39bc4ea719e to your computer and use it in GitHub Desktop.
Save dck-jp/3c978b4217f5b4aef5ece39bc4ea719e to your computer and use it in GitHub Desktop.
bugfix of ProcessX/Zx
static readonly Lazy<CancellationTokenSource> _terminateTokenSource = new Lazy<CancellationTokenSource>(() =>
{
var source = new CancellationTokenSource();
Console.CancelKeyPress += (sender, e) => { source.Cancel(); e.Cancel = true; };
return source;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment