[zsh] fix and improve fallback prompt

This commit is contained in:
2026-02-13 10:26:29 +01:00
parent 25a4a6076c
commit cb1c9ef54f

View File

@@ -1,8 +1,8 @@
if (( EUID == 0 )); then if (( EUID == 0 )); then
# If root, omit the username and print the hostname in red. # If root, omit the username and print the hostname in red.
PS1='%1v%B%F\h %(?..%? )%F{blue}%~ # %f%b' PS1='%1v%B%F{red}%(?..%? )%m %F{blue}%~ # %f%b'
else else
# Otherwise, print the username and hostname in green. # Otherwise, print the username and hostname in green.
PS1='%1v%B%F{green}%n@%m%F{blue} %(?..%F{red}%? %F{blue})%~ $ %f%b' PS1='%1v%B%(?..%F{red}%? )%F{green}%n@%m%F{blue} %~ $ %f%b'
fi fi
RPROMPT=$(date '+%H:%m:%S') RPROMPT=$(date '+%H:%m:%S')