non gnu date compatible, use local vars where possible

This commit is contained in:
Geoffray Levasseur-Brandin
2025-06-19 14:36:13 +02:00
parent eeb87c5bfc
commit a75299f7b4

View File

@@ -38,7 +38,7 @@
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
function timer_now function timer_now
{ {
date +%s%N date +%s%N 2>/dev/null || date +%s
} }
function timer_start function timer_start
@@ -78,19 +78,19 @@ function timer_stop
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
set_prompt() set_prompt()
{ {
Last_Command=$? # Must come first! local Last_Command=$? # Must come first!
Blue='\[\e[0;34m\]' local Blue='\[\e[0;34m\]'
White='\[\e[01;37m\]' local White='\[\e[01;37m\]'
Yellow='\[\e[01;93m\]' local Yellow='\[\e[01;93m\]'
Red='\[\e[01;31m\]' local Red='\[\e[01;31m\]'
Green='\[\e[01;32m\]' local Green='\[\e[01;32m\]'
OnGrey='\[\e[47m\]' local OnGrey='\[\e[47m\]'
OnRed='\[\e[41m\]' local OnRed='\[\e[41m\]'
OnBlue='\[\e[44m\]' local OnBlue='\[\e[44m\]'
ICyan='\[\e[0;96m\]' local ICyan='\[\e[0;96m\]'
Default='\[\e[00m\]' local Default='\[\e[00m\]'
FancyX='\342\234\227' local FancyX='\342\234\227'
Checkmark='\342\234\223' local Checkmark='\342\234\223'
# Begin with time # Begin with time
PS1="\[\e[s$Blue$OnGrey [ \t ] $OnBlue" PS1="\[\e[s$Blue$OnGrey [ \t ] $OnBlue"