Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ctrl+C gets ignored #2019

Closed
tmds opened this issue Jan 13, 2023 · 0 comments · Fixed by #2044
Closed

Ctrl+C gets ignored #2019

tmds opened this issue Jan 13, 2023 · 0 comments · Fixed by #2044
Assignees
Labels
bug Something isn't working

Comments

@tmds
Copy link
Member

tmds commented Jan 13, 2023

using System.CommandLine;

new MyRootCommand().Invoke(args);

sealed class MyRootCommand : RootCommand
{
    public MyRootCommand()
    {
        this.SetHandler(() =>{
            System.Console.WriteLine("Sleeping forever.");
            Thread.Sleep(int.MaxValue);
        });
    }
}

This app should terminate when the user presses Ctrl+C .

It does so when using the package from nuget.org (2.0.0-beta4.22272.1), but it does not with the package from https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-libraries/nuget/v3/index.json (2.0.0-beta4.22613.1).

It may have regressed in #1502, see #1502 (comment).

cc @Keboo @jonsequitur @adamsitnik

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
3 participants