mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-30 02:44:42 +01:00
feat: change apple logo color based on previous return code
This commit is contained in:
parent
b1c5315a5f
commit
f443dc03cd
1 changed files with 7 additions and 2 deletions
|
|
@ -1,5 +1,10 @@
|
|||
function toon {
|
||||
echo -n ""
|
||||
r=$?
|
||||
if [ $r -eq 0 ]; then
|
||||
echo -n "%{$fg[magenta]%}"
|
||||
else
|
||||
echo -n "[$r]"
|
||||
fi
|
||||
}
|
||||
|
||||
autoload -Uz vcs_info
|
||||
|
|
@ -18,7 +23,7 @@ theme_precmd () {
|
|||
}
|
||||
|
||||
setopt prompt_subst
|
||||
PROMPT='%{$fg[magenta]%}$(toon)%{$reset_color%} %~/ %{$reset_color%}${vcs_info_msg_0_}%{$reset_color%}'
|
||||
PROMPT='$(toon)%{$reset_color%} %~/ %{$reset_color%}${vcs_info_msg_0_}%{$reset_color%}'
|
||||
|
||||
autoload -U add-zsh-hook
|
||||
add-zsh-hook precmd theme_precmd
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue