命令提示符中的字符“!1"和“!2" [英] Characters '!1' and '!2' in command prompt

查看:306
本文介绍了命令提示符中的字符“!1"和“!2"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用使用iTerm2,OhMyZsh和Powerlevel10k主题的Mac.我已经直接从Powerlevel10k文档中安装了推荐的字体,并根据文档更新了Terminal,iTerm2和VS Code中的字体设置,并且大多数情况下都可以运行,只是在提示的末尾总是有一些意外的字符(通常是!1或!2).到目前为止,我在文档,论坛搜索或互联网搜索中都找不到任何帮助.

I'm using a Mac using iTerm2, OhMyZsh, and the Powerlevel10k theme. I've installed the recommended fonts directly from the Powerlevel10k docs, updated the settings for fonts in Terminal, iTerm2, and VS Code according to the docs, and it mostly works, except that there is always some unexpected character at the end of the prompt (usually !1 or !2). I've found nothing in the docs, searches of forums, or internet searches that helps with this so far.

提示屏幕截图

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

Any hints that could help me resolve this, even just the right search term to help me find answers would be much appreciated.

推荐答案

来自

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

使用精益经典彩虹样式时,Git状态可能如下所示:

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

传奇:

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

另请参见:如何更改Git状态的格式?

这篇关于命令提示符中的字符“!1"和“!2"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆