mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-12-28 20:39:40 -08:00
refactor(pwsh): check history id instead of command line
This commit is contained in:
parent
48746495d4
commit
e041c23fe1
|
@ -263,7 +263,7 @@ Example:
|
||||||
$global:Error[0] | Where-Object { $_ -ne $null } | Select-Object -ExpandProperty InvocationInfo
|
$global:Error[0] | Where-Object { $_ -ne $null } | Select-Object -ExpandProperty InvocationInfo
|
||||||
} catch { $null }
|
} catch { $null }
|
||||||
# check if the last command caused the last error
|
# check if the last command caused the last error
|
||||||
if ($null -ne $invocationInfo -and $lastHistory.CommandLine -eq $invocationInfo.Line) {
|
if ($null -ne $invocationInfo -and $script:LastHistoryId -eq $invocationInfo.HistoryId) {
|
||||||
$script:ErrorCode = 1
|
$script:ErrorCode = 1
|
||||||
} elseif ($realLASTEXITCODE -is [int] -and $realLASTEXITCODE -ne 0) {
|
} elseif ($realLASTEXITCODE -is [int] -and $realLASTEXITCODE -ne 0) {
|
||||||
# native app exit code
|
# native app exit code
|
||||||
|
|
Loading…
Reference in a new issue