Skip to content

Console.Unix: fix, make CancelKeyPress work when input is redirected. - #52891

Merged
2 commits merged into
dotnet:mainfrom
tmds:sigint_redirected
May 28, 2021
Merged

2 commits merged into
dotnet:mainfrom
tmds:sigint_redirected

Conversation

@tmds

@tmds tmds commented May 18, 2021

Copy link
Copy Markdown
Member

Fixes #51221.

Regressed in 5.0: #34297.

@jeffhandley @adamsitnik @carlossanlop @jozkee ptal

@ghost ghost added the area-System.Console label May 18, 2021
@ghost

ghost commented May 18, 2021

Copy link
Copy Markdown

Tagging subscribers to this area: @carlossanlop
See info in area-owners.md if you want to be subscribed.

Issue Details

Fixes #51221.

Regressed in 5.0: #34297.

@jeffhandley @adamsitnik @carlossanlop @jozkee ptal

Author: tmds
Assignees: -
Labels:

area-System.Console

Milestone: -

@tmds tmds changed the title Console.Unix: fix, make SIGINT work when input is redirected. Console.Unix: fix, make CancelKeyPress work when input is redirected. May 18, 2021
@tmds

tmds commented May 18, 2021

Copy link
Copy Markdown
Member Author

CI is not too happy about this change:

Process terminated. Assertion failed.
   at System.Console.get_Out() in /_/src/libraries/System.Console/src/System/Console.cs:line 195
   at System.ConsolePal.EnsureInitializedCore() in /_/src/libraries/System.Console/src/System/ConsolePal.Unix.cs:line 922
   at System.ConsolePal.EnsureConsoleInitialized() in /_/src/libraries/System.Console/src/System/ConsolePal.Unix.cs:line 915
   at System.ConsolePal.ControlCHandlerRegistrar.Register() in /_/src/libraries/System.Console/src/System/ConsolePal.Unix.cs:line 1451
   at System.Console.add_CancelKeyPress(ConsoleCancelEventHandler value) in /_/src/libraries/System.Console/src/System/Console.cs:line 572
   at Xunit.ConsoleClient.ConsoleRunner.EntryPoint(String[] args) in /_/src/Microsoft.DotNet.XUnitConsoleRunner/src/ConsoleRunner.cs:line 47
   at Xunit.ConsoleClient.Program.Main(String[] args) in /_/src/Microsoft.DotNet.XUnitConsoleRunner/src/Program.cs:line 16

@tmds

tmds commented May 19, 2021

Copy link
Copy Markdown
Member Author

CI failures are now unrelated. This is ready for review.

@stephentoub stephentoub left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for fixing it.

@ghost

ghost commented May 28, 2021

Copy link
Copy Markdown

Hello @stephentoub!

Because this pull request has the auto-merge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@stephentoub stephentoub reopened this May 28, 2021
@ghost
ghost merged commit ff5b9e0 into dotnet:main May 28, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Jun 27, 2021
@adamsitnik adamsitnik added this to the 6.0.0 milestone Aug 13, 2021
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

.NET 5 apps can no longer intercept SIGINT signals (receive CancelKeyPress events) when running under Docker

3 participants