fix timer string logic

This commit is contained in:
Dustin Kirkland 2024-01-23 09:03:34 -06:00
commit 237d811ad8
2 changed files with 6 additions and 16 deletions

4
debian/changelog vendored
View file

@ -2,8 +2,10 @@ byobu (6.10) unreleased; urgency=medium
* debian/compat, debian/control: * debian/compat, debian/control:
- bump compat, fix vcs lintian warning, fix debhelper warnings - bump compat, fix vcs lintian warning, fix debhelper warnings
* usr/share/byobu/profiles/bashrc:
- fix timer string logic
-- Dustin Kirkland <kirkland@ubuntu.com> Mon, 22 Jan 2024 10:29:06 -0600 -- Dustin Kirkland <kirkland@ubuntu.com> Tue, 23 Jan 2024 09:03:16 -0600
byobu (6.9-0ubuntu1) noble; urgency=medium byobu (6.9-0ubuntu1) noble; urgency=medium

View file

@ -44,21 +44,9 @@ byobu_prompt_runtime() {
nanoseconds=$(printf "%.6d" ${nanoseconds}) nanoseconds=$(printf "%.6d" ${nanoseconds})
microseconds=${nanoseconds:0:3} microseconds=${nanoseconds:0:3}
# Shorten our string as much as possible # Shorten our string as much as possible
if [ "$days" = "0" ]; then [ "$days" = "0" ] && days= || days="${days}d "
days= [ "$hours" = "0" ] && hours= || hours="${hours}h "
if [ "$hours" = "0" ]; then [ "$minutes" = "0" ] && minutes= || minutes="${minutes}m "
hours=
if [ "$minutes" = "0" ]; then
minutes=
else
minutes="${minutes}m "
fi
else
hours="${hours}h "
fi
else
days="${days}d "
fi
str="${days}${hours}${minutes}${seconds}.${microseconds}s" str="${days}${hours}${minutes}${seconds}.${microseconds}s"
printf "[%s]" "$str" 1>&2 printf "[%s]" "$str" 1>&2
} }