Allow for longer command min duration
Allows for setting "COMMAND_DURATION_MIN_SECONDS" to more than 60 seconds without adding to prompt. Previously always showed with lengths over 60 seconds regardless of setting.pull/2198/head
parent
feb468b517
commit
12fdc4fb7a
|
|
@ -59,17 +59,17 @@ function _command_duration() {
|
|||
command_duration=0
|
||||
fi
|
||||
|
||||
if ((command_duration > 0)); then
|
||||
if ((command_duration >= COMMAND_DURATION_MIN_SECONDS)); then
|
||||
minutes=$((command_duration / 60))
|
||||
seconds=$((command_duration % 60))
|
||||
fi
|
||||
|
||||
_dynamic_clock_icon "${command_duration}"
|
||||
if ((minutes > 0)); then
|
||||
printf "%s %s%dm %ds" "${COMMAND_DURATION_ICON:-}" "${COMMAND_DURATION_COLOR:-}" "$minutes" "$seconds"
|
||||
elif ((seconds >= COMMAND_DURATION_MIN_SECONDS)); then
|
||||
else
|
||||
printf "%s %s%d.%01ds" "${COMMAND_DURATION_ICON:-}" "${COMMAND_DURATION_COLOR:-}" "$seconds" "$deciseconds"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
_bash_it_library_finalize_hook+=("safe_append_preexec '_command_duration_pre_exec'")
|
||||
|
|
|
|||
Loading…
Reference in New Issue