From ab0a415a3b51afcb427d0238eb7923a2850eb53d Mon Sep 17 00:00:00 2001 From: Jan De Dobbeleer Date: Tue, 27 Oct 2020 12:17:24 +0100 Subject: [PATCH] fix: call Set-PoshContext first resolves #103 --- packages/powershell/oh-my-posh/oh-my-posh.psm1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/powershell/oh-my-posh/oh-my-posh.psm1 b/packages/powershell/oh-my-posh/oh-my-posh.psm1 index 2d40ca36..f47549c1 100644 --- a/packages/powershell/oh-my-posh/oh-my-posh.psm1 +++ b/packages/powershell/oh-my-posh/oh-my-posh.psm1 @@ -45,6 +45,7 @@ function Set-PoshPrompt { [ScriptBlock]$Prompt = { $realLASTEXITCODE = $global:LASTEXITCODE + Set-PoshContext if ($realLASTEXITCODE -isnot [int]) { $realLASTEXITCODE = 0 } @@ -62,7 +63,6 @@ function Set-PoshPrompt { } $process = New-Object System.Diagnostics.Process $process.StartInfo = $startInfo - Set-PoshContext $process.Start() | Out-Null $standardOut = $process.StandardOutput.ReadToEnd() $process.WaitForExit()