Skip to content

Commit 07b9b82

Browse files
fix(pwsh): set lastCommandSuccess first
resolves #849
1 parent 2aa00da commit 07b9b82

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/init/omp.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ function global:Initialize-ModuleSupport {
6767
}
6868

6969
[ScriptBlock]$Prompt = {
70+
#store if the last command was successful
71+
$lastCommandSuccess = $?
72+
#store the last exit code for restore
73+
$realLASTEXITCODE = $global:LASTEXITCODE
7074
$omp = "::OMP::"
7175
$config, $cleanPWD, $cleanPSWD = Get-PoshContext
7276
if ($global:PoshSettings.Transient -eq $true) {
@@ -75,10 +79,6 @@ function global:Initialize-ModuleSupport {
7579
$global:PoshSettings.Transient = $false
7680
return
7781
}
78-
#store if the last command was successful
79-
$lastCommandSuccess = $?
80-
#store the last exit code for restore
81-
$realLASTEXITCODE = $global:LASTEXITCODE
8282
$errorCode = 0
8383
Initialize-ModuleSupport
8484
Set-PoshContext

0 commit comments

Comments
 (0)