Accept prepended zeroes for colors

This commit is contained in:
ItsDrike 2021-07-20 19:58:46 +02:00
parent a3ed7ff347
commit cd08fbd55d
No known key found for this signature in database
GPG key ID: B5F6B41F708C3ADD

View file

@ -200,7 +200,7 @@ function anonymize {
source ${XDG_CONFIG_DIR:-$HOME/.config}/shell/prompt source ${XDG_CONFIG_DIR:-$HOME/.config}/shell/prompt
# Regular expression to match 0-255 numbers (color) # Regular expression to match 0-255 numbers (color)
color_int_re='^([0-9]{1,2}|1[0-9]{2}|2[0-4][0-9]|25[0-5])$' color_int_re='^(0+)?([0-9]{1,2}|1[0-9]{2}|2[0-4][0-9]|25[0-5])$'
# Defaults # Defaults
NAME="%n" NAME="%n"
@ -209,7 +209,7 @@ function anonymize {
NAME_COLOR="%F{172}" NAME_COLOR="%F{172}"
#DIR_COLOR="%F{027}" #DIR_COLOR="%F{027}"
DIR_COLOR="%F{158}" DIR_COLOR="%F{158}"
AT_COLOR="%F{027}" AT_COLOR="%F{004}"
MACHINE_COLOR="%F{070}" MACHINE_COLOR="%F{070}"
while [[ $# -gt 0 ]]; do while [[ $# -gt 0 ]]; do