mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-26 02:12:33 +01:00
style(theme): format prompt_char function for better readability
This commit is contained in:
parent
de1ca65dca
commit
72f428440b
1 changed files with 6 additions and 4 deletions
|
|
@ -1,15 +1,17 @@
|
|||
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[green]%}"
|
||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
|
||||
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}!"
|
||||
ZSH_THEME_GIT_PROMPT_CLEAN=""
|
||||
|
||||
function prompt_char {
|
||||
if [ $UID -eq 0 ]; then echo "%{$fg[red]%}#%{$reset_color%}"; else echo $; fi
|
||||
if [ $UID -eq 0 ]; then
|
||||
echo "%{$fg[red]%}#%{$reset_color%}"
|
||||
else
|
||||
echo $
|
||||
fi
|
||||
}
|
||||
|
||||
PROMPT='%(?, ,%{$fg[red]%}FAIL%{$reset_color%}
|
||||
)
|
||||
PROMPT='${$(exit_code=$?; [[ $exit_code -ne 0 && $exit_code -ne 1 ]] && echo "%{$fg[red]%}FAIL%{$reset_color%}")}
|
||||
%{$fg[magenta]%}%n%{$reset_color%}@%{$fg[yellow]%}%m%{$reset_color%}: %{$fg_bold[blue]%}%~%{$reset_color%}$(git_prompt_info)
|
||||
$(prompt_char) '
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue