You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Consider adding a general capability, independent of current invocation concepts, to align shutdown handling with standard cancellation APIs. (For example, should CancellationToken support be available in async Main?) #1921
Apologies for the absence of a description on this issue. I think the issue might be outside the scope of System.CommandLine but the concept of adding CancellationToken support to Main might be worth a new issue in dotnet/runtime.
I always liked the idea of having a CancellationToken for Main. It was something that also came up when we were discussing the PosixSignal API. See dotnet/runtime#50527 (comment) and following comments.
You can implement it yourself using the PosixSignal API.
Activity
KalleOlaviNiemitalo commentedon Feb 19, 2023
What was decided about the question in the title of this issue:
jonsequitur commentedon Feb 23, 2023
Apologies for the absence of a description on this issue. I think the issue might be outside the scope of System.CommandLine but the concept of adding
CancellationTokensupport toMainmight be worth a new issue in dotnet/runtime.@adamsitnik Thoughts on this?
tmds commentedon Mar 22, 2023
I always liked the idea of having a
CancellationTokenforMain. It was something that also came up when we were discussing thePosixSignalAPI. See dotnet/runtime#50527 (comment) and following comments.You can implement it yourself using the
PosixSignalAPI.cc @davidfowl