mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-02-02 05:41:10 -08:00
fix: exit code always equal 0
The exit code was not captured correctly since the move to the new bootstrap system. It never displays the actual exit code.
This commit is contained in:
parent
4c771d3e15
commit
1bc52c3c48
|
@ -5,15 +5,17 @@ function omp_preexec() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function omp_precmd() {
|
function omp_precmd() {
|
||||||
|
omp_last_error=$?
|
||||||
omp_elapsed=-1
|
omp_elapsed=-1
|
||||||
if [ $omp_start_time ]; then
|
if [ $omp_start_time ]; then
|
||||||
omp_now=$(::OMP:: --millis)
|
omp_now=$(::OMP:: --millis)
|
||||||
omp_elapsed=$(($omp_now-$omp_start_time))
|
omp_elapsed=$(($omp_now-$omp_start_time))
|
||||||
fi
|
fi
|
||||||
eval "$(::OMP:: --config $POSH_THEME --error $? --execution-time $omp_elapsed --eval)"
|
eval "$(::OMP:: --config $POSH_THEME --error $omp_last_error --execution-time $omp_elapsed --eval)"
|
||||||
unset omp_start_time
|
unset omp_start_time
|
||||||
unset omp_now
|
unset omp_now
|
||||||
unset omp_elapsed
|
unset omp_elapsed
|
||||||
|
unset omp_last_error
|
||||||
}
|
}
|
||||||
|
|
||||||
function install_omp_hooks() {
|
function install_omp_hooks() {
|
||||||
|
|
Loading…
Reference in a new issue