From 3ab454c41eab449650ded704fc0e9228304d3179 Mon Sep 17 00:00:00 2001 From: Jakub Skopal Date: Wed, 22 Jan 2025 08:56:19 +0100 Subject: [PATCH] Allow for different numeric format in EPOCHREALTIME for non-English locale --- usr/share/byobu/profiles/bashrc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr/share/byobu/profiles/bashrc b/usr/share/byobu/profiles/bashrc index 7fa07d67..351527be 100644 --- a/usr/share/byobu/profiles/bashrc +++ b/usr/share/byobu/profiles/bashrc @@ -37,8 +37,8 @@ byobu_prompt_runtime() { local starttime endtime duration days hours minutes seconds microseconds nanoseconds str [ ! -r $BYOBU_RUN_DIR/timer.$$ ] && printf "[0.000s]" && return read starttime < $BYOBU_RUN_DIR/timer.$$ 2>/dev/null || true - endtime=${EPOCHREALTIME/./} - starttime=${starttime/./} + endtime=${EPOCHREALTIME/[^0-9]/} + starttime=${starttime/[^0-9]/} duration=$((endtime - starttime)) days=$((duration/1000000/60/60/24)) hours=$((duration/1000000/60/60%24)) @@ -55,7 +55,7 @@ byobu_prompt_runtime() { printf "[%s] " "$str" 1>&2 } # Requires Bash 4.x -export PS0='$(printf "%s" ${EPOCHREALTIME/./} >"$BYOBU_RUN_DIR/timer.$$")' +export PS0='$(printf "%s" ${EPOCHREALTIME/[^0-9]/} >"$BYOBU_RUN_DIR/timer.$$")' case "$BYOBU_DISTRO" in "Ubuntu")