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

PSReadLine 2.2.0-beta 3 breaks extension #3393

Closed
PrzemyslawKlys opened this issue Jun 3, 2021 · 15 comments
Closed

PSReadLine 2.2.0-beta 3 breaks extension #3393

PrzemyslawKlys opened this issue Jun 3, 2021 · 15 comments
Labels
Resolution-Answered Will close automatically.

Comments

@PrzemyslawKlys
Copy link
Contributor

PrzemyslawKlys commented Jun 3, 2021

Issue Description

I am experiencing a problem with... PSReadline 2.2.0-beta3. Once it's installed it impacts VSCode heavily and it's hard to find out what's wrong. The behavior is as shown in the GIF. After pressing F5, nothing happens. I had to go in, delete every entry of PSReadLine in all PowerShells - and just leave PSReadLine that comes with VSCode. It then works, but I guess this should be investigated why this kills VSCode (both preview/production version).

Keep in mind that 2.2.0-beta 3 seems to be a release that is supposed to fix PSReadLine issue with newest Preview of PowerShell, yet it impacts everything else in VSCode. Doesn't impact normal terminal as far as I can tell.

Bug

Attached Logs

1622704773-844d1a68-6356-4a9e-861d-2cec5e5992ed1622704751750.zip

Environment Information

Visual Studio Code

Name Version
Operating System Windows_NT x64 10.0.19043
VSCode 1.56.2
PowerShell Extension Version 2021.5.1

PowerShell Information

Name Value
PSVersion 7.1.3
PSEdition Core
GitCommitId 7.1.3
OS Microsoft Windows 10.0.19043
Platform Win32NT
PSCompatibleVersions 1.0 2.0 3.0 4.0 5.0 5.1.10032.0 6.0.0 6.1.0 6.2.0 7.0.0 7.1.3
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0

Visual Studio Code Extensions

Visual Studio Code Extensions(Click to Expand)
Extension Author Version
better-toml bungcip 0.3.2
codespaces GitHub 0.10.4
debugger-for-edge msjsdiag 1.0.15
errorlens usernamehw 3.2.7
github-linker gimenete 0.2.3
gitlens eamodio 11.4.1
html-preview-vscode george-alisson 0.2.5
LiveServer ritwickdey 5.6.1
markdown-all-in-one yzhang 3.4.0
markdown-preview-enhanced shd101wyy 0.5.18
material-theme zhuangtongfa 3.10.14
open-in-browser techer 2.0.0
pin-up saekiraku 1.4.1
powershell ms-vscode 2021.5.1
project-manager alefragnani 12.1.0
rainbow-brackets 2gua 0.0.6
run-in-powershell tobysmith568 1.1.0
swdc-vscode softwaredotcom 2.5.15
test-adapter-converter ms-vscode 0.0.8
vscode-css-formatter aeschli 1.0.1
vscode-inline-values-powershell TylerLeonhardt 0.0.5
vscode-markdownlint DavidAnson 0.41.1
vscode-simpler-icons davidbabel 1.6.5
vscode-toggle-quotes BriteSnow 0.3.4
vscode-wakatime WakaTime 12.0.0
vscode-yaml redhat 0.19.2
xml DotJoshJohnson 2.5.1
@ghost ghost added the Needs: Triage Maintainer attention needed! label Jun 3, 2021
@kborowinski
Copy link

I have the same issue. On PSReadLine 2.2.0-beta3 and PowerShell 2021.5.1 the debug controls do not work in VSC. I had to rollback to PSReadLine 2.1.0 as workaround.

@PrzemyslawKlys
Copy link
Contributor Author

@daxian-dbw - do you need me to open an issue on PSReadLine repo as well? This may be an issue with PSReadLine itself?

@andyleejordan
Copy link
Member

andyleejordan commented Jun 3, 2021

PSReadLine 2.2.0-beta3 (and beta2, probably all of 2.2.0) is incompatible with the extension right now, we bundle (and only support) 2.1.0. In the past it was decided that the extension should try to use the latest version of PSReadLine installed, despite potential compatibility issues, but we are planning to revert that behavior to avoid bugs just as you all have hit here (PowerShell/PowerShellEditorServices#1493). We would welcome any work done to fix compatibility issues between PowerShell Editor Services and PSReadLine 2.2.0, as when it releases we will need to upgrade the bundled module.

@andyleejordan andyleejordan added Resolution-Answered Will close automatically. and removed Needs: Triage Maintainer attention needed! labels Jun 3, 2021
@daxian-dbw
Copy link
Member

This is strange. Comparing to 2.2.0-beta2, the 2.2.0-beta3 PSReadLine just made the necessary changes to adapt to the new prediction interface in powershell 7.2.0-preview.6, which shouldn't affect the vs code extension in my understanding.

I found the following exception in the 'EditorServices.log', maybe @andschwa can see if this is relevant?

2021-06-03 09:21:39.246 +02:00 [VRB] Response value was null
2021-06-03 09:21:39.246 +02:00 [DBG] Finished: Routing Request (22) shutdown in 2ms
2021-06-03 09:21:39.246 +02:00 [DBG] Finished: Processing request shutdown 22 in 2ms
2021-06-03 09:21:39.303 +02:00 [VRB] Could not write to output handler, perhaps serialization failed?
System.Threading.Channels.ChannelClosedException: The channel has been closed.
at System.Threading.Channels.AsyncOperation`1.GetResult(Int16 token)
at OmniSharp.Extensions.JsonRpc.OutputHandler.ProcessOutputStream(CancellationToken cancellationToken)
2021-06-03 09:21:39.309 +02:00 [VRB] Loaded into load context "Default" System.Runtime.Loader.DefaultAssemblyLoadContext #0: System.Reflection.Metadata, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a

2021-06-03 09:21:39.541 +02:00 [VRB] Execution completed successfully
2021-06-03 09:21:39.542 +02:00 [VRB] Passing to PowerShell
2021-06-03 09:21:39.542 +02:00 [VRB] Sending executionStatusChanged notification
2021-06-03 09:21:39.542 +02:00 [VRB] Session state changed --

@ghost ghost added the Needs: Maintainer Attention Maintainer attention needed! label Jun 3, 2021
@andyleejordan
Copy link
Member

at OmniSharp.Extensions.JsonRpc.OutputHandler.ProcessOutputStream

Interesting...can't say it wouldn't be the first serialization bug with OmniSharp (if that's what's going on).

However, @rjmholt and I found that PSReadLine 2.2.0-beta2 was also incompatible. So it's not just beta3.

@kborowinski
Copy link

@andschwa That is strange. I have reverted to PSReadLine 2.2.0-beta2 and the debug controls work as expected.

@andyleejordan
Copy link
Member

Are you certain beta2 is loading? We found that nothing seemed broken but upon inspection that PSReadLine was failing to load at all when beta2 was installed, and so left us both with the fallback/legacy readline. Try Get-Module PSReadLine and see if it's loaded.

@daxian-dbw
Copy link
Member

We found that nothing seemed broken but upon inspection that PSReadLine was failing to load at all when beta2 was installed ...

Did you use powershell 7.2.0-preview.6 when doing this investigation? The beta2 PSReadLine is only incompatible with preview.6, it would work well with other versions of PowerShell, such as 7.1.x or 7.2.0-preview.5.

@andyleejordan
Copy link
Member

Nope, just regular PowerShell 7.1.x.

@kborowinski
Copy link

@andschwa Yeah it loads but on PowerShell 5.1 and on 7.2.0-preview.5:

psreadline

@PrzemyslawKlys
Copy link
Contributor Author

I'm pretty sure 2.2.0-beta used to work fine until PS 7.2.0-preview6 - where it wouldn't work correctly (but only in that PS). Both PowerShell 7 and PowerShell 5.1 worked fine until i updated to beta3.

@rkeithhill
Copy link
Contributor

rkeithhill commented Jun 3, 2021

Interesting - PSRL does not load for me in PSIC Preview 2021.5.1:

image

What the heck? Somehow I fat fingered some keyboard shortcut that closed this. Sorry, will re-open.

@kborowinski What prerelease version of PSRL 2.2.0 are you using? gmo PSReadline | % PrivateData | % PSData

@rkeithhill rkeithhill reopened this Jun 3, 2021
@andyleejordan
Copy link
Member

andyleejordan commented Jun 3, 2021

I'm pretty sure 2.2.0-beta used to work fine until PS 7.2.0-preview6 - where it wouldn't work correctly (but only in that PS). Both PowerShell 7 and PowerShell 5.1 worked fine until i updated to beta3.

This is expected. 2.2.0-beta is incompatible with PS 7.2.0-preview6:

PSReadLine 2.2.0-beta1 and 2.2.0-beta2 do not work with this preview of PowerShell due to breaking changes in the prediction interface. The upcoming PSReadLine 2.2.0-beta3 release will resolve this. Use PSReadLine 2.1.0 as the temporary workaround.

2.2.0-beta3 has just come out and I certainly haven't tested it with the extension, as we ship and support 2.1.0.

Interesting - PSRL does not load for me in PSIC Preview 2021.5.1:

If you have anything higher than 2.1.0, then I believe this is also expected, as it's what Rob and I experienced too. 2.2.0 is still in beta and doesn't load properly with the extension, it's incompatible right now.

@andyleejordan andyleejordan removed the Needs: Maintainer Attention Maintainer attention needed! label Jun 3, 2021
@kborowinski
Copy link

@rkeithhill PSReadLine 2.2.0-beta2:

Bukem@ATLANTIS > gmo PSReadline; gmo PSReadline | % PrivateData | % PSData


ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Script     2.2.0      PSReadline                          {Get-PSReadLineKeyHandler, Get-PSReadLineOption, Remove-PSReadLineKeyHandler, Set-PSReadLineKeyHandler...}

Key   : ProjectUri
Value : https://github.com/PowerShell/PSReadLine
Name  : ProjectUri


Key   : Prerelease
Value : beta2     
Name  : Prerelease

@ghost ghost added the Needs: Maintainer Attention Maintainer attention needed! label Jun 3, 2021
@andyleejordan
Copy link
Member

Hey all, I am going to let the bot close this issue. Thanks for beta testing PSReadLine and reporting the incompatibility issue. Fortunately the workaround is to use the latest stable release of PSReadLine. @daxian-dbw and I will coordinate to ensure the stable release of PSReadLine 2.2.0 is compatible and works as expected, and in the next release of the extension (which we don't yet have a date for) we will also lock to the bundled PSReadLine dependency so you're free to beta test PSReadLine without it interfering with the extension.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution-Answered Will close automatically.
Projects
None yet
Development

No branches or pull requests

5 participants