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