首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法在oh-my-posh提示符中识别未编码元素的来源

无法在oh-my-posh提示符中识别未编码元素的来源
EN

Stack Overflow用户
提问于 2021-04-15 22:35:01
回答 1查看 38关注 0票数 0

我在Windows终端中使用的是哦-my-posh v3。

如果我在非git目录中,我的提示符如下所示...

但是,在启用了git的目录中,它看起来像这样...

我已经将主题的定义导出到json,正如您所看到的,我找不到任何与提示符中的第一个块有关的内容。

代码语言:javascript
复制
{
  "$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
  "blocks": [
    {
      "alignment": "left",
      "segments": [
        {
          "background": "#c386f1",
          "foreground": "#ffffff",
          "leading_diamond": "",
          "style": "diamond",
          "trailing_diamond": "",
          "type": "session"
        },
        {
          "background": "#ff479c",
          "foreground": "#ffffff",
          "powerline_symbol": "",
          "properties": {
            "prefix": "  ",
            "style": "folder"
          },
          "style": "powerline",
          "type": "path"
        },
        {
          "background": "#fffb38",
          "foreground": "#193549",
          "powerline_symbol": "",
          "properties": {
            "display_stash_count": true,
            "display_upstream_icon": true
          },
          "style": "powerline",
          "type": "git"
        },
        {
          "background": "#f36943",
          "foreground": "#193549",
          "powerline_symbol": "",
          "properties": {
            "battery_icon": "",
            "charged_color": "#4caf50",
            "charging_color": "#40c4ff",
            "color_background": true,
            "discharging_color": "#ff5722",
            "postfix": " "
          },
          "style": "powerline",
          "type": "battery"
        },
        {
          "background": "#6CA35E",
          "foreground": "#ffffff",
          "powerline_symbol": "",
          "properties": {
            "prefix": "  "
          },
          "style": "powerline",
          "type": "node"
        },
        {
          "background": "#0077c2",
          "foreground": "#ffffff",
          "powerline_symbol": "",
          "properties": {
            "prefix": " ﲵ "
          },
          "style": "powerline",
          "type": "shell"
        },
        {
          "background": "#ffff66",
          "foreground": "#193549",
          "powerline_symbol": "",
          "style": "powerline",
          "type": "root"
        },
        {
          "background": "#2e9599",
          "foreground": "#ffffff",
          "leading_diamond": "",
          "properties": {
            "always_enabled": true,
            "color_background": true,
            "display_exit_code": false,
            "error_color": "#f1184c",
            "prefix": "<transparent></> "
          },
          "style": "diamond",
          "trailing_diamond": "",
          "type": "exit"
        }
      ],
      "type": "prompt"
    }
  ],
  "final_space": true
}

我的$Profile看起来像这样。

代码语言:javascript
复制
Import-Module posh-git
Import-Module oh-my-posh
Import-Module -Name Terminal-Icons
Set-PoshPrompt -Theme jandedobbeleer

有人能告诉我这是从哪里来的吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-04-15 23:32:16

答案很简单:从我的$profile中删除Import-Module posh-git

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/67110498

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档