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.59k stars 628 forks source link

virtualnev name not showing. #210

Open pradhanvickey opened 3 years ago

pradhanvickey commented 3 years ago

Hi - I can just see my python version of virtual env not the virtual env name. Please let me know who to fix it. and i want to print virtualenv name to the right side. Is it possible?

image

eusojk commented 3 years ago

@pradhanvickey, I have the same issue. Were you able to find a solution somehow?

shelfofclub commented 2 years ago

I found that powerline series themes can show conda virtual environment name. But the default theme "font" can't. I think there may be some bugs in function virtualenv_prompt which font theme uses. Powerline theme use the function __powerline_python_venv_prompt defined by itself. So there may be something about $VIRTUAL_ENV.

I'm not good at bash shell script. If I have some wrong, please correct me.

juanswan13 commented 2 years ago

I created this PR to show Virtual Env on the Sirup theme: https://github.com/ohmybash/oh-my-bash/pull/335

It's just needed to be approved and merged or you guys can just check the code and replace it directly in your environment. For me, it's working now.

joaco18 commented 2 years ago

I'm facing this problem with agnoster and powerline themes after an OS update, this wasn't the behavior in previous versions, why did they change it? I don't find it clearly how to fix it following @juanswan13 example to be honest.

akinomyoga commented 2 years ago

@joaco18

Q1. Which problem are you facing? Actually, it seems to me that people are talking about several different problems in this single issue. For example,

Q2. What is the result of the following command?

$ declare -p VIRTUAL_ENV
joaco18 commented 2 years ago

Thanks @akinomyoga for your answer, you were right in deed, my comment was not useful at all.

My problem is this one:

"Or, it might be the problem that the area of the virtualenv information is not shown."

I'm using agnoster theme in a Ubuntu 22.04 OS. I'm using anaconda environments. For example I'm in base environment and the command line shows: jseia@petalo  ~ 

The output for: $ declare -p VIRTUAL_ENV is: bash: declare: VIRTUAL_ENV: not found Thanks for any help.

akinomyoga commented 2 years ago

I'm using anaconda environments.

Ah, OK. So you are actually using "condaenv" instead of "virtualenv". I have checked agnoster, but agnoster only supports "virtualenv" but not "condaenv". Maybe you have switched from venv to conda when you updated the operating system? It seems #282 is an example to support "condaenv" in agnoster, though it seems to also contain unrelated style changes.

akinomyoga commented 2 years ago

I have rebased #282 and reverted unrelated changes.