Skip to content

Ctrl+C gets ignored #2019

Closed
Closed
@tmds

Description

@tmds
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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions