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

Additional changes to allow PSReadLine to work in CLM #1290

Merged
merged 4 commits into from
Jun 6, 2020

Conversation

TylerLeonhardt
Copy link
Member

This is pending a 2.0.2 release of PSRL that has a fix for CLM.

On Windows PowerShell, for some reason... when PSReadLine is not a trusted module, gmo -list does not show it. As a workaround, we attempt to load PSRL from our module path.

This ensures PSRL will be loaded when the PSRL feature is used.

@TylerLeonhardt TylerLeonhardt marked this pull request as draft May 15, 2020 16:14
@@ -729,7 +729,7 @@ private async Task WritePromptStringToHostAsync(CancellationToken cancellationTo
{
}

PSCommand promptCommand = new PSCommand().AddScript("prompt");
PSCommand promptCommand = new PSCommand().AddScript("prompt", useLocalScope: true);
Copy link
Collaborator

Choose a reason for hiding this comment

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

If prompt is usually dot-sourced in normal PowerShell, it might be worth adding a comment here. If this actually converts us to use normal behaviour, then no comment needed I imagine

Copy link
Member Author

Choose a reason for hiding this comment

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

How silly of me... prompt is a function... so I switched to using AddCommand :)

@TylerLeonhardt TylerLeonhardt marked this pull request as ready for review June 6, 2020 22:27
$module = Get-Module -ListAvailable PSReadLine |
Where-Object { $_.Version -gt '2.0.0' -or ($_.Version -eq '2.0.0' -and -not $_.PrivateData.PSData.Prerelease) } |
Where-Object {{ $_.Version -ge '2.0.2' }} |
Copy link
Collaborator

Choose a reason for hiding this comment

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

Might be worth taking the version here out into a constant

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll do that next time 😅 I really don't want to test on my SAW again lol

@TylerLeonhardt TylerLeonhardt merged commit dbd0e46 into PowerShell:master Jun 6, 2020
@TylerLeonhardt TylerLeonhardt deleted the psrl-clm branch June 6, 2020 22:47
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