我正在使用 vcs_info 在提示符中添加有关 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 上。