From 8f64285d271470379acba169310dd3a544347a7d Mon Sep 17 00:00:00 2001 From: Jan De Dobbeleer Date: Sat, 1 Feb 2020 20:03:14 +0100 Subject: [PATCH] Also validate $? for $lastexitcode Resolves #52 --- oh-my-posh.psm1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oh-my-posh.psm1 b/oh-my-posh.psm1 index 3225d484..d33291aa 100644 --- a/oh-my-posh.psm1 +++ b/oh-my-posh.psm1 @@ -12,7 +12,7 @@ function Set-Prompt { Import-Module $sl.CurrentThemeLocation -Force [ScriptBlock]$Prompt = { - $lastCommandFailed = $global:error.Count -gt $sl.ErrorCount + $lastCommandFailed = ($global:error.Count -gt $sl.ErrorCount) -or -not $? $sl.ErrorCount = $global:error.Count #Start the vanilla posh-git when in a vanilla window, else: go nuts