Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can i see conda env in oh my posh theme in powershell?

I have install oh-my-posh, and i use blue-owl theme. From documentation i add these lines of code to json file;

{
    "type": "python",
    "style": "powerline",
    "powerline_symbol": "\uE0B0",
    "foreground": "#100e23",
    "background": "#906cff",
    "template": " \uE235 {{ .Full }}"
},

enter image description here

But i can't see my conda environment. I search about it but can't find any thing. Can you help me to add my conda env to powershell?

I try to add following line:

{
    "type": "command",
    "style": "blue",
    "powerline": "left",
    "foreground": "#F0DB4F",
    "background": "#4F5D75",
    "properties": {
        "command": "conda activate base",
        "leading_icon": " "
    }
},

But nothing change. I can't see conda env.


2 Answers

From the docs:

{
    "type": "python",
    "style": "powerline",
    "powerline_symbol": "\uE0B0",
    "foreground": "#100e23",
    "background": "#906cff",
    "template": " \uE235 {{ .Full }} {{ if .Venv }}{{ .Venv }}{{ end }}",
    "properties": {
        "fetch_virtual_env": true
    }
},
like image 195
Jan De Dobbeleer Avatar answered Oct 30 '25 13:10

Jan De Dobbeleer


Add the content below to segments in block in the theme file currently used.

{
  "type": "python",
  "style": "plain",
  "foreground": "#ffffff",
  "properties": {
    "display_virtual_env": true,
    "display_default": true,
    "display_version": false,
    "home_enabled": true,
    "prefix": "\uE235 ",
    "postfix": " ",
    "display_mode": "always"
    }
},
like image 23
笑先生 Avatar answered Oct 30 '25 14:10

笑先生



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!