fix(fish): get last element from history

resolves #3632
This commit is contained in:
Jan De Dobbeleer 2023-04-19 08:29:16 +02:00 committed by Jan De Dobbeleer
parent facc24d290
commit d5b0886aea

View file

@ -39,7 +39,8 @@ function fish_prompt
set_poshcontext set_poshcontext
# validate if the user cleared the screen # validate if the user cleared the screen
set --local omp_cleared false set --local omp_cleared false
if test (history | head -1) = "clear" set --local last_command (history search --max 1)
if test "$last_command" = "clear"
set omp_cleared true set omp_cleared true
end end
::OMP:: print primary --config $POSH_THEME --shell fish --error $omp_status_cache --execution-time $omp_duration --stack-count $omp_stack_count --shell-version $FISH_VERSION --cleared=$omp_cleared ::OMP:: print primary --config $POSH_THEME --shell fish --error $omp_status_cache --execution-time $omp_duration --stack-count $omp_stack_count --shell-version $FISH_VERSION --cleared=$omp_cleared