diff options
author | Dennis Eriksen <d@ennis.no> | 2023-01-06 11:09:33 +0100 |
---|---|---|
committer | Dennis Eriksen <d@ennis.no> | 2023-01-06 11:09:33 +0100 |
commit | 995f2ef6fca60e4246907857c1f1f1c30a40688d (patch) | |
tree | 4e574dfff395f14305a1f6172d7df8f6c60cc8ee | |
parent | made it possible to specify both fore- and background color, AND boldness. Al... (diff) | |
download | adam3-995f2ef6fca60e4246907857c1f1f1c30a40688d.tar.gz |
Apparently %* does not zero-pad the hours. I want zero-padding.
-rw-r--r-- | prompt_adam3_setup | 4 |
1 files changed, 2 insertions, 2 deletions
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} |