Skip to content

Commit 237d811

Browse files
fix timer string logic
1 parent a38bfe0 commit 237d811

File tree

2 files changed

+6
-16
lines changed

2 files changed

+6
-16
lines changed

debian/changelog

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ byobu (6.10) unreleased; urgency=medium
22

33
* debian/compat, debian/control:
44
- bump compat, fix vcs lintian warning, fix debhelper warnings
5+
* usr/share/byobu/profiles/bashrc:
6+
- fix timer string logic
57

6-
-- Dustin Kirkland <[email protected]> Mon, 22 Jan 2024 10:29:06 -0600
8+
-- Dustin Kirkland <[email protected]> Tue, 23 Jan 2024 09:03:16 -0600
79

810
byobu (6.9-0ubuntu1) noble; urgency=medium
911

usr/share/byobu/profiles/bashrc

+3-15
Original file line numberDiff line numberDiff line change
@@ -44,21 +44,9 @@ byobu_prompt_runtime() {
4444
nanoseconds=$(printf "%.6d" ${nanoseconds})
4545
microseconds=${nanoseconds:0:3}
4646
# Shorten our string as much as possible
47-
if [ "$days" = "0" ]; then
48-
days=
49-
if [ "$hours" = "0" ]; then
50-
hours=
51-
if [ "$minutes" = "0" ]; then
52-
minutes=
53-
else
54-
minutes="${minutes}m "
55-
fi
56-
else
57-
hours="${hours}h "
58-
fi
59-
else
60-
days="${days}d "
61-
fi
47+
[ "$days" = "0" ] && days= || days="${days}d "
48+
[ "$hours" = "0" ] && hours= || hours="${hours}h "
49+
[ "$minutes" = "0" ] && minutes= || minutes="${minutes}m "
6250
str="${days}${hours}${minutes}${seconds}.${microseconds}s"
6351
printf "[%s]" "$str" 1>&2
6452
}

0 commit comments

Comments
 (0)