1
0
Fork 0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-11-19 04:10:09 +00:00

trapd00r: optimize reset of foreground colors

This commit is contained in:
Marc Cornellà 2018-08-20 17:50:11 +02:00
parent 4774bc62d5
commit 3d1719c618

View file

@ -55,28 +55,29 @@ zsh_path() {
if [[ $c = "/" ]]; then if [[ $c = "/" ]]; then
if [[ $i -eq 1 ]]; then if [[ $i -eq 1 ]]; then
if [[ $colors -ge 256 ]]; then if [[ $colors -ge 256 ]]; then
print -Pn '%F{065}%B /%b%f' print -Pn "%F{065}%B /%b"
else else
print -Pn '\e[31;1m /%f' print -Pn "\e[31;1m /"
fi fi
(( i++ )) (( i++ ))
continue continue
fi fi
if [[ $colors -ge 256 ]]; then if [[ $colors -ge 256 ]]; then
print -Pn "${yellow[$i]:-%f} » %f" print -Pn "${yellow[$i]:-%f} » "
else else
print -Pn "%F{yellow} > %f" print -Pn "%F{yellow} > "
fi fi
(( i += 6 )) (( i += 6 ))
else else
if [[ $colors -ge 256 ]]; then if [[ $colors -ge 256 ]]; then
print -Pn "%F{065}$c%f" print -Pn "%F{065}$c"
else else
print -Pn "%F{blue}$c%f" print -Pn "%F{blue}$c"
fi fi
fi fi
done done
print -Pn "%f"
} }