Skip to content

Commit

Permalink
fix(fish): cache status code
Browse files Browse the repository at this point in the history
resolves #1013
  • Loading branch information
JanDeDobbeleer committed Oct 3, 2021
1 parent f67ee8e commit 1f3127c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/init/omp.fish
Expand Up @@ -3,8 +3,9 @@ set -g POWERLINE_COMMAND "oh-my-posh"
set -g CONDA_PROMPT_MODIFIER false

function fish_prompt
set -l omp_stack_count (count $dirstack)
set -l omp_duration "$CMD_DURATION$cmd_duration"
set omp_status_cache $status
set omp_stack_count (count $dirstack)
set omp_duration "$CMD_DURATION$cmd_duration"
# check if variable set, < 3.2 case
if set -q omp_lastcommand; and test "$omp_lastcommand" = ""
set omp_duration 0
Expand All @@ -17,7 +18,7 @@ function fish_prompt
set -gx omp_last_status_generation $status_generation
end

::OMP:: --config $posh_theme --error $status --execution-time $omp_duration --stack-count $omp_stack_count
::OMP:: --config $posh_theme --error $omp_status_cache --execution-time $omp_duration --stack-count $omp_stack_count
end

function postexec_omp --on-event fish_postexec
Expand Down

0 comments on commit 1f3127c

Please sign in to comment.