-
Notifications
You must be signed in to change notification settings - Fork 490
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 doesn't get loaded on some systems (and behaves unexpectedly if loaded manually) #1834
Comments
Is this why backticks aren't working in the terminal? (I'm having the issue documented on #1299)
|
That is why backticks aren't working in v1.12.0 of the extension. This specific issue was filed against the PowerShell Preview (v2.0.1) which can load PSReadLine with a number of caveats (setting FeatureFlags and grabbing PSReadLine 2.0.0 beta4). |
What's that point about FeatureFlags? Did I miss something that needs to be done to enable PSReadLine with the PowerShell [extension] Preview? If that's the case, my apologies, because this will render this issue moot... Note: Even with Windows PowerShell 5.1, I sometimes get "PSReadline not loaded. Console will run without PSReadline." (or whatever the exact message is). |
Yup, our intent was to not require the PSReadLine feature flag for the 2.0.1 preview release. But there's a bug that prevents PSRL from loading in that preview unless you specify the feature flag e.g.:
|
Tada! With that line added, I get the expected behavior.
I will test on the other affected systems at home. For some reason I must've added the FeatureFlag setting on some but not all of my systems -- because this was a documented requirement for version 2.0.0 of the preview? Shall we close this issue and optionally link it to the bug you were referring to? P.S. Sorry for the "noise" ;-) |
Indeed it was. |
Yeah, I'll go ahead and close this one. We have the link to that other defect in one of the messages above. |
Thanks @rkeithhill. @sba923 PSRL will be on by default for Windows starting with the next release of the preview. |
And of course it'll come with PSRL beta4 or newer 😎 |
@rkeithhill Where might we find Is |
PSReadLine should be loaded from:
assuming you are using the PowerShell Preview extension... If you see:
this probably means you're actually running the Stable version of the PowerShell extension and you should disable that and enable the PowerShell Preview extension. |
Here's the official blog post with all of the steps: |
@TylerLeonhardt Um, yeah... 😞 PSReadLine does not appear to be loading from the PowerShell Extension directory but the preview is definitely installed. Is the import of PSReadLine done explicitly by the PowerShell Extension? To my eyes it seems PSReadLine is just loading from the first module it finds. If I disable the module in my profile directory PSReadLine loads from BTW, PSReadLine vi-mode works like I would expect.
|
@gwojan what version of PowerShell are you using? Just to confirm, you have the feature flag on, correct? |
Also, what's the output of: gmo -list PSReadLine | % { $_.PrivateData.PSData.Prerelease } We do our best to load the latest PSReadLine we find, but there's no ordering of prerelease tags. You may want to delete some of your PSReadLine installations there. |
I did have to scan my systems for older versions of PSRL. I wrote the attached two scripts to help me out with that:
HTH |
Issue Description
While helping out with issue #1570 I had to replace all instances of PSReadLine on my systems with 2.0.0 beta4, and to make sure VScode would either run with that version of PSReadLine, or that a workaround from @fMichaleczek would be in place.
To do this, I have instrumented my
Microsoft.VSCode_profile.ps1
with code that checks the output ofGet-Module PSReadLine
so as to check which version of PSReadLine is be used.On some machines, I noticed that
Get-Module PSReadLine
returns$null
.I have modified the instrumentation so that it would load PSReadLine using
Import-Module PSReadLine
when PSReadLine is found not to be loaded. When this is done, PSReadLine does get loaded and enabled, but doesn't function as expected: saved-on-disk history is not restored, syntax highlighing is not performed.Attached are:
CheckPSReadLineStatus.ps1
script that checks whether PSReadLine is loaded and loads it if notMicrosoft.VSCode_profile.ps1
On a system where everything works fine the integrated console displays:
On a system where the problem occurs the output is:
Expected Behaviour
PSReadLine should always be loaded in the PowerShell Integrated Console
Actual Behaviour
On some systems PSReadLine doesn't get loaded, and when loaded by invoking
Import-Module PSReadLine
fromMicrosoft.VSCode_profile.ps1
it doesn't behave properly: saved-on-disk history is not restored, syntax highlighing is not done.Attached Logs
(PSES logs from a system where the problem occurs)
System Details
System Details Output from a system where the problem occurs
PSES_logs_SBAHOME_1554181156-ad5e7b0b-733a-48f5-8290-4b9400aa3d881554180886264_20190402.zip
Microsoft.VSCode_profile.ps1.zip
CheckPSReadLineStatus.zip
The text was updated successfully, but these errors were encountered: