Oh my posh设置显示conda环境名称

image
如何给 oh my posh(下文称为 OMP)添加 python 的环境名称在前面:

首先确定现在使用的OMP主题:
image
我们可以到下面这个文件位置


可见,我们使用的主题为:1_shell

这时候,我们打开OMP的主题 文件夹
C:\Users\23757\AppData\Local\Programs\oh-my-posh\themes

image
在众多主题中找到 上文的主题,打开

在 blocks 中的 segments 中,加入对于Python的配置
image
显示 conda 环境

代码如下
{
“type”: “python”,
“style”: “plain”,
“foreground”: “#98C379”,
“properties”: {
“display_virtual_env”: true,
“dispplay_default”: true,
“display_version”: false,
“home_enabled”: true,
“prefix”: "\uE235 ",
“postfix”: " ",
“display_mode”: “always”
}
},