fish: show command duration after longer command

This commit is contained in:
Daniel Lundin 2024-10-06 23:00:01 +02:00
parent 6b386be43b
commit 39dcb58a9b
Signed by: dln
SSH key fingerprint: SHA256:dQy1Xj3UiqJYpKR5ggQ2bxgz4jCH8IF+k3AB8o0kmdI

View file

@ -107,6 +107,12 @@
fish_right_prompt.body = ''
fish_jj_prompt || fish_vcs_prompt
if test $CMD_DURATION -gt 3000
# Show duration of the last command in seconds
set duration (echo "$CMD_DURATION 1000" | awk '{printf "%.1fs", $1 / $2}')
echo " $duration"
end
'';
transient_prompt_func.body = ''