From 995f2ef6fca60e4246907857c1f1f1c30a40688d Mon Sep 17 00:00:00 2001 From: Dennis Eriksen Date: Fri, 6 Jan 2023 11:09:33 +0100 Subject: Apparently %* does not zero-pad the hours. I want zero-padding. --- prompt_adam3_setup | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'prompt_adam3_setup') diff --git a/prompt_adam3_setup b/prompt_adam3_setup index 50a1e54..3b885b0 100644 --- a/prompt_adam3_setup +++ b/prompt_adam3_setup @@ -54,7 +54,7 @@ prompt_adam3_setup () { prom[dirD]='%-10<..<%~%<<' # Time - [[ $timecolor != false ]] && prom[time]='%*' + [[ $timecolor != false ]] && prom[time]='%D{%H:%M:%S}' # SHLVL prom[shlvl]='%(10L.%F{58}%L%f .)' @@ -145,7 +145,7 @@ prompt_adam3_precmd () { # We need to recalculate prompt_length to know where to put time prompt_length=${#${(S%%)prom//\%([BSUbfksu]|[FK]\{*\})/}} local rprompt_length=${#${(S%%)PROMPT_ADAM3_RPS1//\%([BSUbfksu]|[FK]\{*\})/}} - local timepadding=$((COLUMNS - prompt_length + $#PROMPT_ADAM3_RPS1 - rprompt_length - 1)) + local timepadding=$((COLUMNS - prompt_length + $#PROMPT_ADAM3_RPS1 - rprompt_length - 3 )) # Add time. Left-pad with spaces. prom+=${(l:$timepadding:)PROMPT_ADAM3_RPS1} -- cgit v1.2.3