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

Update the use of the prediction interface to adapt to the breaking changes introduced in PowerShell 7.2.0-preview.6 #2524

Merged
merged 5 commits into from
Jun 1, 2021

Conversation

daxian-dbw
Copy link
Member

@daxian-dbw daxian-dbw commented May 31, 2021

PR Summary

Fix #2495
Update the use of the prediction interface to adapt to the breaking changes introduced in PowerShell 7.2.0-preview.6.

  1. Use a PredictionClient instance to represent the client information. Today it includes the client name and the client type.
  2. Send the feedback about the execution result of the last accepted command (success or failure).

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: Open in CodeFlow

@ghost
Copy link

ghost commented Jun 1, 2021

🎉 v2.2.0-beta3 has been released which incorporates this pull request. 🎉

@HerbM
Copy link

HerbM commented Jun 20, 2021

After installing PSReadLine 2.2.0-beta3 and starting a new console using 7.2-Preview.5 (because 6 is unusable with old PSReadLine) the console works but calls to PSReadLine functions generally throw errors. (See below for examples)

PSVersion                      7.2.0-preview.5
OS                             Microsoft Windows 10.0.21390

Get-Module PSReadLine

Script     2.2.0      beta3      PSReadLine

Get-PSReadLineKeyHandler

Get-PSReadLineKeyHandler: The type initializer for 'Microsoft.PowerShell.PSConsoleReadLine' threw an exception.

Get-PSReadLineOption

Get-PSReadLineOption: The type initializer for 'Microsoft.PowerShell.PSConsoleReadLine' threw an exception.

No reboot was performed prior to this.
Other consoles with older PSReadLine were still running (separate processes).
PowerShell 7.2-Preview6 is NOT installed

@daxian-dbw
Copy link
Member Author

@HerbM The 2.2.0-beta3 works with PowerShell 7.2.0-preview.6 and above versions. If you need to work with all 7.2 preview versions of PowerShell, try using 2.1.0 PSReadLine.

@HerbM
Copy link

HerbM commented Jul 2, 2021

@HerbM The 2.2.0-beta3 works with PowerShell 7.2.0-preview.6 and above versions. If you need to work with all 7.2 preview versions of PowerShell, try using 2.1.0 PSReadLine.

Yes, PSReadline 2.2.0-beta3 does work with PowerShell 7.2.0-preview6 which I confirmed over on the PSReadline issue that I was referred to for this issue.

However, it is important that one either removes PSReadLine beta before upgrading as it will make all of PowerShell useless even with -NoProfile until PowerShell is also update.

FWIW: And also this is all working on Windows 11 22000.51

Thanks.

@stknohg stknohg mentioned this pull request Nov 9, 2021
3 tasks
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.

PSReadline crashed on daily build
2 participants