Skip to content

Conversation

Tunduk
Copy link
Contributor

@Tunduk Tunduk commented Jul 28, 2022

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.

@Tunduk
Copy link
Contributor Author

Tunduk commented Aug 3, 2022

@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

@baronfel
Copy link
Member

baronfel commented Aug 3, 2022

Yes of course! Thank you for the ping - this just slipped my mind.

@baronfel
Copy link
Member

baronfel commented Aug 3, 2022

This looks good to me, but I'd appreciate @mkArtakMSFT or @captainsafia taking a look, as they own watch.

@Tunduk Tunduk force-pushed the 25961-watch-console-fix branch from 1696530 to 462bbf0 Compare January 29, 2023 12:52
@Tunduk
Copy link
Contributor Author

Tunduk commented Jan 29, 2023

@baronfel Hi! Can I do something to push this PR forward?

Copy link
Member

@captainsafia captainsafia left a 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?

@Tunduk
Copy link
Contributor Author

Tunduk commented Feb 22, 2023

Thanks for your reply, @captainsafia ! I'll check if I can add a test for this.
Should we ping somebody to update CODEOWNERS file?

@mkArtakMSFT
Copy link
Contributor

@tmat can you please review this? Thanks!

{
var key = Console.ReadKey(intercept: true);
for (var i = 0; i < _keyPressedListeners.Count; i++)
if (Console.KeyAvailable)
Copy link
Member

Choose a reason for hiding this comment

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

Console

This doesn't look right. Are we gonna be spinning the CPU at 100% until there is a key available?

Copy link
Contributor Author

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

Copy link
Contributor Author

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

@Tunduk Tunduk force-pushed the 25961-watch-console-fix branch from 462bbf0 to e17c1fa Compare March 3, 2023 08:53
@marcpopMSFT
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dotnet watch Console.ReadLine() does not read first key stroke

6 participants