I installed Arch Linux and migrated my .zshrc over and am using the bart prompt theme. I see the normal theme on the first line (hostname; last command run; pwd; and time) but on the next line is: \[\][ \[\]hostname \[\]\W\[\] \[\]]\[\]# \[\]
where $hostname is my actual hostname.
I renamed the files in my /etc/zsh
to backup.zshrc
backup.zprofile
and backup.keephack
. The prompt on my other computer is uncluttered so I know it's not something in the ~/.zshrc
that I migrated over.
1 Answer
This is a bash prompt, so a bash setting has somehow leaked to zsh. All common shells use the PS1
variable as the primary prompt, but they use different formats. Since PS1
has different meanings to different programs, it should never be an environment variable, only a variable in each program that uses it (bash, zsh, etc.). Unfortunately, many distributions ship default files that set PS1
in the environment, often in /etc/profile
.
Zsh uses more than PS1
to build its prompt. I don't know how your prompt theme works, but it's plausible that it combines multiple elements including PS1
. Because PS1
is being set in a way it's shouldn't, zsh ends up picking a stray bash setting.
Therefore a likely fix is to add unset PS1
in your .zshrc
. Depending on how the prompt theme works, you may or may not need to do that before setting the prompt theme.