Skip to content

Commit

Permalink
Disable PowerShell strict mode in shell integration's prompt function
Browse files Browse the repository at this point in the history
  • Loading branch information
andyleejordan committed Jan 3, 2023
1 parent 503abcd commit c20ca3a
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ function Global:__VSCode-Escape-Value([string]$value) {
}

function Global:Prompt() {
# NOTE: We disable strict mode for the scope of this function because it unhelpfully throws an
# error when $LastHistoryEntry is null, and is not otherwise useful.
Set-StrictMode -Off
$FakeCode = [int]!$global:?
$LastHistoryEntry = Get-History -Count 1
# Skip finishing the command if the first command has not yet started
Expand Down

0 comments on commit c20ca3a

Please sign in to comment.