Skip to content
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

Work around InvalidOperationExceptions from Console API #3755

Conversation

jazzdelightsme
Copy link
Contributor

@jazzdelightsme jazzdelightsme commented Jul 25, 2023

PR Summary

Addresses #3744

There is a problem with the .NET Console API, described in this Issue:

https://github.com/dotnet/runtime/issues/88697

This change works around the problem by handling the InvalidOperationException that might spuriously fly out of KeyAvailable and ReadKey (with a limited number of retries, in case there is something else pathological going on).

PR Checklist

  • PR has a meaningful title
    • Use the present tense and imperative mood when describing your changes
  • Summarized changes
  • Make sure you've added one or more new tests
  • Make sure you've tested these changes in terminals that PowerShell is commonly used in (i.e. conhost.exe, Windows Terminal, Visual Studio Code Integrated Terminal, etc.)
  • User-facing changes
    • Not Applicable
    • OR
    • Documentation needed at PowerShell-Docs
      • Doc Issue filed:
Microsoft Reviewers: codeflow:open?pullrequest=https://github.com/PowerShell/PSReadLine/pull/3755&drop=dogfoodAlpha

Addresses PowerShell#3744

There is a problem with the .NET Console API, described in this Issue:

    dotnet/runtime#88697

This change works around the problem by handling the
InvalidOperationException that might spuriously fly out of KeyAvailable
and ReadKey (with a limited number of retries, in case there is
something *else* pathological going on).
Copy link
Member

@daxian-dbw daxian-dbw left a comment

Choose a reason for hiding this comment

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

LGTM

@daxian-dbw daxian-dbw merged commit e5537d8 into PowerShell:master Jul 27, 2023
2 checks passed
@jazzdelightsme jazzdelightsme deleted the user/danthom/workaround_dotnet_console_IOEs branch July 27, 2023 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants