ZSH issue with colorized prompt and double slash, i.e "//" appearing when I am into root
How to make path prompt easier to read by color-coding each `/` (forward slash)?


Change the for loop from 

for (i=1; i&lt;=NF; i++) \
 printf blue $i pink "/"; \
printf "\n"


to

for (i=1; i&lt;NF; i++) \
 printf blue $i pink "/"; \
printf blue $NF pink; \
printf "\n"



notice the change in &lt;= → &lt;
Take care of semi-colons.


or use some help from searching to get an if else condition for which the pseudocode (not correct bash syntax) is:

for all i&lt;=NF:
 if (i&lt;NF):
   printf blue $i pink "/" ;
 else:
   printf blue $i pink ;
printf "\n";