Fix Exustion Time
This commit is contained in:
+10
-5
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user