ohmybash / oh-my-bash

A delightful community-driven framework for managing your bash configuration, and an auto-update tool so that makes it easy to keep up with the latest updates from the community.
https://ohmybash.github.io
MIT License
5.73k stars 642 forks source link

Current conda env name is not shown #117

Open sulsj opened 4 years ago

sulsj commented 4 years ago

Hi, I can see virtualenv env name with "font" theme, but I can't see conda env name.

This is virtualenv

03:43:05 sulsj@sjsul-lm-2 ~ → source ~/venv/bin/activate 03:43:11 (venv) sulsj@sjsul-lm-2 ~ →

And this is conda

03:41:16 sulsj@sjsul-lm-2 bin → conda env list # conda environments: # base * /Users/sulsj/miniconda2

03:41:50 sulsj@sjsul-lm-2 bin → conda activate 03:42:01 sulsj@sjsul-lm-2 bin → conda deactivate 03:42:08 sulsj@sjsul-lm-2 bin →

Any fix?

Alwaysproblem commented 3 years ago

same question

anyong298 commented 3 years ago

same question. This feature is necessary.

anyong298 commented 3 years ago

@Alwaysproblem @sulsj FYI, I changed my theme to 'powerline' and it works now. image My OS is Ubuntu 18.04.

Alwaysproblem commented 3 years ago

Thank you @anyong298 , I already add conda venv and python version to the theme tonotdo by calling python_version_prompt from basic.theme.sh

shunzh commented 3 years ago

I'm using the default theme (font). It's implemented to show $(virtualenv_prompt) in font.theme.sh. I changed it to $(condaenv_prompt) and now it worked. I also added a space between env prompt and hostname prompt for aesthetic purpose. I first tried python_version_prompt, but it shows the environment name followed by the interpreter version? That's not what I want.

Cppowboy commented 3 years ago

Same question. Any help to solve this problem?

muntakim1 commented 3 years ago

Same question. Any help to solve this problem?

Which theme you are using? if you are using the font theme then follow the shunzh's comment

botsunny commented 2 years ago

For anyone who is using Agnoster, I enabled conda environment names by referring to https://github.com/speedenator/agnoster-bash/pull/24. Just add those 4 lines as seen in the 'Files changed tab' into prompt_virtualenv(). Credits to @prehensilecode