-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[25961] - dotnet watch first key press fix #26870
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
Conversation
@baronfel Hi! Sorry to bother you but the issue is assigned to you. Maybe you can review this PR? It's really small and I am just afraid that PR won't get in .NET7 release |
Yes of course! Thank you for the ping - this just slipped my mind. |
This looks good to me, but I'd appreciate @mkArtakMSFT or @captainsafia taking a look, as they own watch. |
1696530
to
462bbf0
Compare
@baronfel Hi! Can I do something to push this PR forward? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, although I don't own the watch
area anymore. I think we'll need to update the CODEOWNERS file.
@Tunduk Is there a way to add tests for this scenario?
Thanks for your reply, @captainsafia ! I'll check if I can add a test for this. |
@tmat can you please review this? Thanks! |
{ | ||
var key = Console.ReadKey(intercept: true); | ||
for (var i = 0; i < _keyPressedListeners.Count; i++) | ||
if (Console.KeyAvailable) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, you are right. I missed that.
I've tried to play around with the Process.StandartInput stream but it causes more problems.
Spinning CPU is bad, but I don't see another solution
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course, we can call something like Thread.Sleep(100)
but this will not look good too
462bbf0
to
e17c1fa
Compare
Old PR review: This PR is more than a year old and does not appear to have active engagement. A reviewer has been notified offline to review and take action. If no action is taken, this PR will be closed in 14 days. Please comment if you want this PR left open for further investigation. |
Fixes #25961
Now dotnet-watch can't restart by Ctrl+R if watched process "take"
Console
, but I don't think that it is a problem.