【发布时间】:2015-01-27 20:43:04
【问题描述】:
为什么它不起作用?提示区是空的,我没有错误。
setopt prompt_subst
git_prompt() {
temp=`git symbolic-ref HEAD 2>/dev/null | cut -d / -f 3`
if [ "$temp" != "" ]; then
RPROMPT='%{$fg_no_bold[green]%}git:($temp%)%{$reset_color%} %{$fg_no_bold[yellow]%}[%1~]%{$reset_color%}'
else
RPROMPT='%{$fg_no_bold[yellow]%}[%~]%{$reset_color%}'
fi
}
RPROMPT='$(git_prompt)'
RPROMPT 的值拼写正确且不包含错误。
【问题讨论】:
-
你想做什么?
标签: linux unix terminal console zsh