aboutsummaryrefslogtreecommitdiffstats
path: root/crates
diff options
context:
space:
mode:
Diffstat (limited to 'crates')
-rw-r--r--crates/atuin/src/shell/atuin.ps14
1 files changed, 3 insertions, 1 deletions
diff --git a/crates/atuin/src/shell/atuin.ps1 b/crates/atuin/src/shell/atuin.ps1
index 3ff4824a..33c2ba5f 100644
--- a/crates/atuin/src/shell/atuin.ps1
+++ b/crates/atuin/src/shell/atuin.ps1
@@ -63,7 +63,8 @@ New-Module -Name Atuin -ScriptBlock {
$lastRunStatus = $?
# Exit statuses are maintained separately for native and PowerShell commands, this needs to be taken into account.
- $exitCode = if ($lastRunStatus) { 0 } elseif ($global:LASTEXITCODE) { $global:LASTEXITCODE } else { 1 }
+ $lastNativeExitCode = $global:LASTEXITCODE
+ $exitCode = if ($lastRunStatus) { 0 } elseif ($lastNativeExitCode) { $lastNativeExitCode } else { 1 }
## 2. Report the status of the previous command to Atuin (atuin history end).
@@ -125,6 +126,7 @@ New-Module -Name Atuin -ScriptBlock {
$env:ATUIN_COMMAND_LINE = $null
}
+ $global:LASTEXITCODE = $lastNativeExitCode
return $line
}