【问题标题】:Characters '!1' and '!2' in command prompt命令提示符中的字符 '!1' 和 '!2'
【发布时间】:2020-05-28 18:33:57
【问题描述】:

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

screenshot of prompt

非常感谢任何可以帮助我解决此问题的提示,即使只是帮助我找到答案的正确搜索词。

【问题讨论】:

    标签: fonts character command-prompt iterm2 oh-my-zsh


    【解决方案1】:

    来自Powerlevel10k FAQ

    问:Git 状态中不同的符号是什么意思?

    当使用 LeanClassicRainbow 样式时,Git 状态可能如下所示:

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

    传说:

    | 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` |
    

    另见:How do I change the format of Git status?

    【讨论】:

    • 非常感谢。这有助于我充分了解我正在寻找的答案。
    • 我在寻找* (stash) 的含义并找到了这个。这值得更多的选票。 ?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-01-26
    • 1970-01-01
    • 1970-01-01
    • 2018-04-26
    • 1970-01-01
    • 2016-10-25
    • 1970-01-01
    相关资源
    最近更新 更多