命令提示符中的字符“!1”和“!2”

Characters '!1' and '!2' in command prompt

我正在使用 Mac,它使用 iTerm2、OhMyZsh 和 Powerlevel10k 主题。我已经直接从 Powerlevel10k 文档安装了推荐的字体,根据文档更新了 Terminal、iTerm2 和 VS Code 中的字体设置,并且它大部分工作,除了提示末尾总是有一些意外的字符(通常是 !1 或 !2)。到目前为止,我在文档、论坛搜索或 Internet 搜索中找不到任何对此有帮助的内容。

screenshot of prompt

任何可以帮助我解决此问题的提示,即使是帮助我找到答案的正确搜索词,我们也将不胜感激。

来自Powerlevel10k FAQ

Q: What do different symbols in Git status mean?

When using Lean, Classic or Rainbow style, Git status may look like this:

feature:master ⇣42⇡42 ⇠42⇢42 *42 merge ~42 +42 !42 ?42

Legend:

| Symbol    | Meaning                                                              | Source                                                 |
| --------- | -------------------------------------------------------------------- | ------------------------------------------------------ |
| `feature` | current branch; replaced with `#tag` or `@commit` if not on a branch | `git status --ignore-submodules=dirty`                 |
| `master`  | remote tracking branch; only shown if different from local branch    | `git rev-parse --abbrev-ref --symbolic-full-name @{u}` |
| `⇣42`     | this many commits behind the remote                                  | `git status --ignore-submodules=dirty`                 |
| `⇡42`     | this many commits ahead of the remote                                | `git status --ignore-submodules=dirty`                 |
| `⇠42`     | this many commits behind the push remote                             | `git rev-list --left-right --count HEAD...@{push}`     |
| `⇢42`     | this many commits ahead of the push remote                           | `git rev-list --left-right --count HEAD...@{push}`     |
| `*42`     | this many stashes                                                    | `git stash list`                                       |
| `merge`   | repository state                                                     | `git status --ignore-submodules=dirty`                 |
| `~42`     | this many merge conflicts                                            | `git status --ignore-submodules=dirty`                 |
| `+42`     | this many staged changes                                             | `git status --ignore-submodules=dirty`                 |
| `!42`     | this many unstaged changes                                           | `git status --ignore-submodules=dirty`                 |
| `?42`     | this many untracked files                                            | `git status --ignore-submodules=dirty`                 |
| `─`       | the number of staged, unstaged or untracked files is unknown         | `echo $POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY` or `git config --get bash.showDirtyState` |

See also: How do I change the format of Git status?