Fix Exustion Time

This commit is contained in:
BlackNet Dev
2020-05-14 22:47:49 +02:00
parent 63b99c22a4
commit b28dbd7c15
+10 -5
View File
@@ -4,6 +4,7 @@
# Fork from shellder <https://github.com/simnalamburt/shellder>
#
RAINBOW_KEEP_PATH=0
#
# Segment drawing
#
@@ -458,6 +459,14 @@ preexec() {
timer=$SECONDS
}
precmd() {
if [ $timer ]; then
local now=$SECONDS
elapsed=$(($now-$timer))
unset timer
fi
}
prompt_error() {
if [ $RETVAL -ne 0 ] && [ "$preexec_called" = 1 ]; then
prompt_segment_right $RAINBOW_STATUS_ERROR_BG $RAINBOW_STATUS_ERROR_FG '✘ %? '
@@ -478,11 +487,7 @@ prompt_status() {
}
prompt_excursion_time() {
if [ $timer ]; then
now=$SECONDS
elapsed=$(($now-$timer))
unset $timer;
unset $now;
if [ $elapsed ]; then
hours=$(($elapsed/3600))
min=$(($elapsed/60))