How can I convert this Bash prompt to zsh? I have the following configuration for Bash:
#   Change Prompt
#   ------------------------------------------------------------
    export PS1=&quot;________________________________________________________________________________\n| \e[0;34m\u\e[m@\e[0;32m\h\e[m {\e[0;33m\w\e[m} --- \e[0;35m\D{%F %T}\e[m \n| $: &quot;
    export PS2=&quot;|  $: &quot;

I tried replacing the \ with %, but it didn't work. What can I do to make this work in zsh?
Essentially this ends up looking like the following (minus colors):
________________________________________________________________________________
| user1@MacBook-Pro {~} --- 2020-09-14 13:17:39
| $:
As others have already mentioned, there are built-in sequences for setting colours, like %F{red}. If you want to include more exotic terminal control codes, you can do it like this:
PS1=$'%{\e[1m%}%m%{\e[0m%}'

(This should make the prompt display your hostname in boldface, on most typical terminals.) There are two things to notice here

Using the $'... ' quoting mechanism to include control characters in the string. This is described under QUOTING in the zshmisc(1) man page. (In other words, this is what makes \e work).

Using %{...%} to indicate that the enclosed sequence does not cause the cursor to move.

(%m expands to the host name. This is described under PROMPT SEQUENCES in zshmisc(1), but you probably knew this already.)


(Alright then, three things. Monty Python fans will know what reference I would put here, others won't care. :-) )