mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-20 05:23:20 -07:00
Merge 3ab454c41e
into cd253f0229
This commit is contained in:
commit
6a2d475345
1 changed files with 3 additions and 3 deletions
|
@ -37,8 +37,8 @@ byobu_prompt_runtime() {
|
||||||
local starttime endtime duration days hours minutes seconds microseconds nanoseconds str
|
local starttime endtime duration days hours minutes seconds microseconds nanoseconds str
|
||||||
[ ! -r $BYOBU_RUN_DIR/timer.$$ ] && printf "[0.000s]" && return
|
[ ! -r $BYOBU_RUN_DIR/timer.$$ ] && printf "[0.000s]" && return
|
||||||
read starttime < $BYOBU_RUN_DIR/timer.$$ 2>/dev/null || true
|
read starttime < $BYOBU_RUN_DIR/timer.$$ 2>/dev/null || true
|
||||||
endtime=${EPOCHREALTIME/./}
|
endtime=${EPOCHREALTIME/[^0-9]/}
|
||||||
starttime=${starttime/./}
|
starttime=${starttime/[^0-9]/}
|
||||||
duration=$((endtime - starttime))
|
duration=$((endtime - starttime))
|
||||||
days=$((duration/1000000/60/60/24))
|
days=$((duration/1000000/60/60/24))
|
||||||
hours=$((duration/1000000/60/60%24))
|
hours=$((duration/1000000/60/60%24))
|
||||||
|
@ -55,7 +55,7 @@ byobu_prompt_runtime() {
|
||||||
printf "[%s] " "$str" 1>&2
|
printf "[%s] " "$str" 1>&2
|
||||||
}
|
}
|
||||||
# Requires Bash 4.x
|
# 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
|
case "$BYOBU_DISTRO" in
|
||||||
"Ubuntu")
|
"Ubuntu")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue