mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-14 18:57:20 -07:00
fix timer string logic
This commit is contained in:
parent
a38bfe0925
commit
237d811ad8
2 changed files with 6 additions and 16 deletions
|
@ -44,21 +44,9 @@ byobu_prompt_runtime() {
|
|||
nanoseconds=$(printf "%.6d" ${nanoseconds})
|
||||
microseconds=${nanoseconds:0:3}
|
||||
# Shorten our string as much as possible
|
||||
if [ "$days" = "0" ]; then
|
||||
days=
|
||||
if [ "$hours" = "0" ]; then
|
||||
hours=
|
||||
if [ "$minutes" = "0" ]; then
|
||||
minutes=
|
||||
else
|
||||
minutes="${minutes}m "
|
||||
fi
|
||||
else
|
||||
hours="${hours}h "
|
||||
fi
|
||||
else
|
||||
days="${days}d "
|
||||
fi
|
||||
[ "$days" = "0" ] && days= || days="${days}d "
|
||||
[ "$hours" = "0" ] && hours= || hours="${hours}h "
|
||||
[ "$minutes" = "0" ] && minutes= || minutes="${minutes}m "
|
||||
str="${days}${hours}${minutes}${seconds}.${microseconds}s"
|
||||
printf "[%s]" "$str" 1>&2
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue