mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-11-10 04:54:03 -08:00
fix: fish 3.2 empty command duration
This commit is contained in:
parent
838567cbcd
commit
494d3b2d20
|
@ -1,11 +1,22 @@
|
|||
function fish_prompt
|
||||
set -l omp_duration "$CMD_DURATION$cmd_duration"
|
||||
if test "$omp_lastcommand" = ""
|
||||
set omp_duration 0
|
||||
# check if variable set, < 3.2 case
|
||||
if set -q omp_lastcommand; and test "$omp_lastcommand" = ""
|
||||
set omp_duration 0
|
||||
end
|
||||
# works with fish >=3.2
|
||||
if set -q omp_last_status_generation; and test "$omp_last_status_generation" = "$status_generation"
|
||||
set omp_duration 0
|
||||
end
|
||||
if set -q status_generation
|
||||
set -gx omp_last_status_generation $status_generation
|
||||
end
|
||||
|
||||
::OMP:: --config ::CONFIG:: --error $status --execution-time $omp_duration
|
||||
end
|
||||
|
||||
function postexec_omp --on-event fish_postexec
|
||||
# works with fish <3.2
|
||||
# pre and postexec not fired for empty command in fish >=3.2
|
||||
set -gx omp_lastcommand $argv
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue