Skip to content

Fix shell integration for PowerShell 5.1 #170516

Merged
Tyriar merged 2 commits intomicrosoft:mainfrom
andyleejordan:andschwa/shell-integration
Jan 12, 2023
Merged

Fix shell integration for PowerShell 5.1 #170516
Tyriar merged 2 commits intomicrosoft:mainfrom
andyleejordan:andschwa/shell-integration

Conversation

@andyleejordan
Copy link
Member

The pipeline operator cannot be used on a new line, which caused #167068.

Also sets the dubious runtime "strict mode" PowerShell feature off in the prompt function. Note that this is off by default, but can be turned on by users, leading to cryptic issues as this code expects $LastHistoryEntry.Id to just be return $Null when $LastHistoryEntry is $Null (a reasonable expectation and valid PowerShell code, just against "strict" mode's guidelines). This caused PowerShell/vscode-powershell#4343.

Image of it working again:

Screenshot 2023-01-03 at 12 23 25 PM

@andyleejordan andyleejordan force-pushed the andschwa/shell-integration branch from 4e1b0e2 to 6313d41 Compare January 4, 2023 18:02
@Tyriar Tyriar added this to the January 2023 milestone Jan 10, 2023
Copy link
Member

@Tyriar Tyriar left a comment

Choose a reason for hiding this comment

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

Thanks @andschwa 👍

@Tyriar Tyriar merged commit 7e54126 into microsoft:main Jan 12, 2023
@andyleejordan andyleejordan deleted the andschwa/shell-integration branch January 12, 2023 17:43
@github-actions github-actions bot locked and limited conversation to collaborators Feb 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants