base prompt now supports 256 and 24 bit color

This commit is contained in:
2026-02-25 15:25:29 -08:00
parent 2612c8efa8
commit e994a270f2
3 changed files with 43 additions and 22 deletions

View File

@@ -2,7 +2,20 @@
# RPROMPT="%(?..%{$fg[red]%}%? )$RPROMPT"
function prompt_userathost () {
print "%{$fg_bold[cyan]%}%n%{$fg_bold[white]%}@%{$fg_bold[magenta]%}%m %{$fg_bold[white]%}%~"
if [[ $colorcount -gt 256 ]]; then
fgcyan="%F{#5bcffa}"
fgmagenta="%F{#f5abb9}"
fgwhite="%F{#ffffff}"
elif [[ $colorcount -eq 256 ]]; then
fgcyan="\e[38;5;39m"
fgmagenta="\e[38;5;210m"
fgwhite="\e[38;5;255m"
else
fgcyan="$fg_bold[cyan]"
fgmagenta="$fg_bold[magenta]"
fgwhite="$fg_bold[white]"
fi
print "%{$fgcyan%}%n%{$fgwhite%}@%{$fgmagenta%}%m %{$fgwhite%}%~"
}
prompt_functions+=prompt_userathost