mirror of
https://github.com/ajeetdsouza/zoxide.git
synced 2026-11-06 12:50:31 -04:00
PowerShell: keep $LASTEXITCODE across the prompt hook (#1342)
Co-authored-by: Ajeet D'Souza <98ajeet@gmail.com>
This commit is contained in:
co-authored by
Ajeet D'Souza
parent
816227d035
commit
f0b31631d2
@@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
- Nushell: `z` now handles relative paths through symlinked directories.
|
||||
- POSIX: fix `z` failing to enter directories whose names start with `-`.
|
||||
- Build: fix compilation failing when the source directory is read-only.
|
||||
- PowerShell: the prompt hook no longer resets `$LASTEXITCODE`.
|
||||
|
||||
## [0.10.0] - 2026-07-04
|
||||
|
||||
|
||||
@@ -93,7 +93,9 @@ if ($global:__zoxide_hooked -ne 1) {
|
||||
if ($null -ne $__zoxide_prompt_old) {
|
||||
& $__zoxide_prompt_old
|
||||
}
|
||||
$exitCode = Microsoft.PowerShell.Utility\Get-Variable LASTEXITCODE -Scope Global -ErrorAction Ignore -ValueOnly
|
||||
$null = __zoxide_hook
|
||||
$global:LASTEXITCODE = $exitCode
|
||||
}
|
||||
}
|
||||
{%- endif %}
|
||||
|
||||
Reference in New Issue
Block a user