我正在使用vcs_info将有关git的信息添加到我的提示符中。我已经配置好了:
现在,我有一个包含当前更改的git仓库,即一个已暂存和未暂存的文件:
然而,我的提示忽略了未暂存的文件,只显示已暂存文件的!。它的样子如下:
setopt promptsubst
autoload -Uz vcs_info
zstyle ':vcs_info:*' enable git
zstyle ':vcs_info:*' check-for-changes true
zstyle ':vcs_info:*' stagedstr '!'
zstyle ':vcs_info:*' unstagedstr '?'
zstyle ':vcs_info:*' formats '[%b]%c%u'
...
PROMPT='${vcs_info_msg_0_}$ '
现在,我有一个包含当前更改的git仓库,即一个已暂存和未暂存的文件:
# On branch test
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# new file: a
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# b
然而,我的提示忽略了未暂存的文件,只显示已暂存文件的!。它的样子如下:
[test]!$
我可能误解了%u应该输出的内容,或者在某个地方打错了字。我使用的是zsh 4.3.17。