From a75299f7b405cb744dd20afd7b6bf51b5803db44 Mon Sep 17 00:00:00 2001 From: Geoffray Levasseur-Brandin Date: Thu, 19 Jun 2025 14:36:13 +0200 Subject: [PATCH] non gnu date compatible, use local vars where possible --- profile.d/prompt.sh | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/profile.d/prompt.sh b/profile.d/prompt.sh index 1aef8ee..6f65498 100644 --- a/profile.d/prompt.sh +++ b/profile.d/prompt.sh @@ -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"