fix(zsh prompt): _get_time miscalculation

This commit is contained in:
ange 2024-04-25 23:33:41 +02:00
parent 3fe43f80b3
commit 10ca6d2791
Signed by: ange
GPG Key ID: 9E0C4157BB7BEB1D

View File

@ -1,6 +1,6 @@
autoload -Uz vcs_info colors && colors
export VIRTUAL_ENV_DISABLE_PROMPT=1
VIRTUAL_ENV_DISABLE_PROMPT=1
export GROFF_NO_SGR=1
export LESS_TERMCAP_mb="${fg_bold[red]}"
@ -42,10 +42,11 @@ function _get_time() {
local text
text="$((d % 60))s"
if [ "$d" -gt 60 ]; then
if [ "$d" -ge 60 ]; then
(( d /= 60 ))
text="$((d % 60))m$text"
if [ "$d" -gt 60 ]; then
if [ "$d" -ge 60 ]; then
(( d /= 60 ))
text="${d}h$text"
fi
fi