Fix Exustion Time
This commit is contained in:
+10
-5
@@ -4,6 +4,7 @@
|
|||||||
# Fork from shellder <https://github.com/simnalamburt/shellder>
|
# Fork from shellder <https://github.com/simnalamburt/shellder>
|
||||||
#
|
#
|
||||||
|
|
||||||
|
RAINBOW_KEEP_PATH=0
|
||||||
#
|
#
|
||||||
# Segment drawing
|
# Segment drawing
|
||||||
#
|
#
|
||||||
@@ -458,6 +459,14 @@ preexec() {
|
|||||||
timer=$SECONDS
|
timer=$SECONDS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
precmd() {
|
||||||
|
if [ $timer ]; then
|
||||||
|
local now=$SECONDS
|
||||||
|
elapsed=$(($now-$timer))
|
||||||
|
unset timer
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
prompt_error() {
|
prompt_error() {
|
||||||
if [ $RETVAL -ne 0 ] && [ "$preexec_called" = 1 ]; then
|
if [ $RETVAL -ne 0 ] && [ "$preexec_called" = 1 ]; then
|
||||||
prompt_segment_right $RAINBOW_STATUS_ERROR_BG $RAINBOW_STATUS_ERROR_FG '✘ %? '
|
prompt_segment_right $RAINBOW_STATUS_ERROR_BG $RAINBOW_STATUS_ERROR_FG '✘ %? '
|
||||||
@@ -478,11 +487,7 @@ prompt_status() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
prompt_excursion_time() {
|
prompt_excursion_time() {
|
||||||
if [ $timer ]; then
|
if [ $elapsed ]; then
|
||||||
now=$SECONDS
|
|
||||||
elapsed=$(($now-$timer))
|
|
||||||
unset $timer;
|
|
||||||
unset $now;
|
|
||||||
|
|
||||||
hours=$(($elapsed/3600))
|
hours=$(($elapsed/3600))
|
||||||
min=$(($elapsed/60))
|
min=$(($elapsed/60))
|
||||||
|
|||||||
Reference in New Issue
Block a user