Skip to content
This repository has been archived by the owner on Feb 16, 2021. It is now read-only.

Commit

Permalink
Add Options.PreserveLastExitCode
Browse files Browse the repository at this point in the history
  • Loading branch information
gregmac authored and JanDeDobbeleer committed Sep 25, 2020
1 parent c5a4b58 commit 4c5225b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions defaults.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,9 @@ $global:ThemeSettings = New-Object -TypeName PSObject -Property @{
VirtualEnvBackgroundColor = [ConsoleColor]::Red
}
Options = @{
ConsoleTitle = $true
OriginSymbols = $false
ConsoleTitle = $true
OriginSymbols = $false
PreserveLastExitCode = $true
}
}

Expand Down
4 changes: 3 additions & 1 deletion oh-my-posh.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ function Set-Prompt {
}

$prompt
$global:LASTEXITCODE = $realLASTEXITCODE
if ($sl.Options.PreserveLastExitCode) {
$global:LASTEXITCODE = $realLASTEXITCODE
}
Remove-Variable realLASTEXITCODE -Confirm:$false
}

Expand Down

0 comments on commit 4c5225b

Please sign in to comment.