Update prompt

Signed-off-by: Aleksandar 'The Cobra' Widulski <thecobra@riseup.net>
This commit is contained in:
Aleksandar 'The Cobra' Widulski 2022-03-08 14:15:01 -05:00
parent 1bf51a1f8e
commit c2ac59eba6
1 changed files with 5 additions and 6 deletions

11
.prompt
View File

@ -38,12 +38,7 @@ __sig() {
j=0
for i in $@; do
if [[ $j != 0 ]]; then
printf '%s' "$WHT"
[[ $(eval echo \${$((j+1))}) == ";"
|| $(eval echo \${$((j-1))}) == ";" ]] &&
printf ";" ||
printf "|"
printf '%s' "$RED"
printf '%s|%s' "$WHT" "$RED"
fi
j=$((j+1))
case $i in
@ -102,6 +97,10 @@ __prompt() {
# Get relative times
# Remove decimal point, simulating multiplying by 1 million
PROMPT_RT1M="${PROMPT_RT%.*}${PROMPT_RT#*.}"
LAST_RT1M="${LAST_RT%.*}${LAST_RT#*.}"
# Subtract and divide by 1 million to get a more accurate difference
CMD_TIME="$(((PROMPT_RT1M-LAST_RT1M)/1000000))"
CMD_TIME="${CMD_TIME:-0}"