Add return value to zsh prompt if nonzero

This commit is contained in:
2025-04-29 14:11:07 +08:00
parent f203391ee6
commit 1c69b6de79

View File

@@ -86,3 +86,6 @@ emulate bash
[ -f "$HOME/.rc-local" ] && source "$HOME/.rc-local" [ -f "$HOME/.rc-local" ] && source "$HOME/.rc-local"
emulate zsh emulate zsh
[ -f "$HOME/.zshrc-local" ] && source "$HOME/.zshrc-local" [ -f "$HOME/.zshrc-local" ] && source "$HOME/.zshrc-local"
# Add return value to prompt if nonzero
PS1='%(!.%B%F{red}.%B%F{green}%n@)%m %F{blue}%(!.%1~.%~) ${vcs_info_msg_0_}%F{blue}%(?..%F{red}[%?] )%F{blue}%(!.#.$)%b%f '