Skip to content

Ctrl+C gets ignored #2019

Closed
Closed

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

Activity

  1. added
    bug
    on Jan 13, 2023
  2. self-assigned this
    on Feb 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions