Skip to content

Console.Unix: fix missing terminal configuration on SIGINT/SIGQUIT/SGCONT. #64200

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

Merged
merged 1 commit into from
Feb 7, 2022

Conversation

tmds
Copy link
Member

@tmds tmds commented Jan 24, 2022

The introduction of the managed API for signal handling (PosixSignal)
inadvertently caused terminal configuration to no longer be performed
when no managed handlers are registered.

This adds back the unconditional registration for SIGINT/SIGQUIT/SIGCONT.

The missing registrations can cause the terminal to stop echoing when an
application terminates on Ctrl-C.

Regressed in #54136.
Fixes #64166.

cc @stephentoub @adamsitnik @danielbisar

…GCONT.

The introduction of the managed API for signal handling (PosixSignal)
inadvertently caused terminal configuration to no longer be performed
when no managed handlers are registered.

This adds back the unconditional registration for SIGINT/SIGQUIT/SIGCONT.

The missing registrations can cause the terminal to stop echoing when an
application terminates on Ctrl-C.
@ghost ghost added area-System.Net community-contribution Indicates that the PR has been added by a community member labels Jan 24, 2022
@ghost
Copy link

ghost commented Jan 24, 2022

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

Issue Details

The introduction of the managed API for signal handling (PosixSignal)
inadvertently caused terminal configuration to no longer be performed
when no managed handlers are registered.

This adds back the unconditional registration for SIGINT/SIGQUIT/SIGCONT.

The missing registrations can cause the terminal to stop echoing when an
application terminates on Ctrl-C.

Regressed in #54136.
Fixes #64166.

cc @stephentoub @adamsitnik @danielbisar

Author: tmds
Assignees: -
Labels:

area-System.Net

Milestone: -

@ghost
Copy link

ghost commented Jan 24, 2022

Tagging subscribers to this area: @dotnet/area-system-console
See info in area-owners.md if you want to be subscribed.

Issue Details

The introduction of the managed API for signal handling (PosixSignal)
inadvertently caused terminal configuration to no longer be performed
when no managed handlers are registered.

This adds back the unconditional registration for SIGINT/SIGQUIT/SIGCONT.

The missing registrations can cause the terminal to stop echoing when an
application terminates on Ctrl-C.

Regressed in #54136.
Fixes #64166.

cc @stephentoub @adamsitnik @danielbisar

Author: tmds
Assignees: -
Labels:

area-System.Console, area-System.Net, community-contribution

Milestone: -

Copy link
Member

@stephentoub stephentoub left a comment

Choose a reason for hiding this comment

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

Thanks. Is there any reasonable way to add a test for this?

@tmds
Copy link
Member Author

tmds commented Jan 25, 2022

Is there any reasonable way to add a test for this?

I thought about it, and it's not easy to write an automated test for this. A good test would have something other than .NET as a parent because .NET changes terminal settings also as child processes are created/reaped.

@tmds
Copy link
Member Author

tmds commented Feb 1, 2022

@stephentoub @adamsitnik is this good to be merged?

After it sat on main for a while, can we backport it to 6.0?

@stephentoub stephentoub merged commit e9a7a3f into dotnet:main Feb 7, 2022
@stephentoub
Copy link
Member

Thanks, Tom.

@adamsitnik
Copy link
Member

@tmds thanks for the fix! I am going to start the backport procedure now, as I expect that it will take us few weeks to get it merged

/backport to release/6.0

@adamsitnik
Copy link
Member

/backport to release/6.0

@github-actions
Copy link
Contributor

github-actions bot commented Feb 8, 2022

Started backporting to release/6.0: https://github.com/dotnet/runtime/actions/runs/1812920689

@ghost ghost locked as resolved and limited conversation to collaborators Mar 10, 2022
@danmoseley
Copy link
Member

I closed the backport PR as stale. cc @dotnet/area-system-console since @tmds is requesting we backport this. One of them would have to champion it, add the template, etc.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Console community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Console.ReadLine on Ubuntu in WSL disables echo of characters when cancelled with Ctrl-C
4 participants