oh-my-bash
oh-my-bash copied to clipboard
virtualnev name not showing.
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?
@pradhanvickey, I have the same issue. Were you able to find a solution somehow?
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.
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.
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.
@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,
- OP is talking about the problem that the Python version is shown instead of the path
- I think I have seen a problem that
virtualenv
or other information is shown in black letters on a black background so it appears as a blank area of finite width. - Or, it might be the problem that the area of the
virtualenv
information is not shown. - Another possibility is just that the
virtualenv
is unsupported by the selected theme. @juanswan13 is providing the solution for the problem that thesirup
theme does not show the virtualenv path simply becausesirup
does not support it. But, I don't think this applies to your case becauseagnoster
andpowerline
themes seemed supposed to support it.
Q2. What is the result of the following command?
$ declare -p VIRTUAL_ENV
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.
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.
I have rebased #282 and reverted unrelated changes.