Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

virtualnev name not showing. #210

Open
pradhanvickey opened this issue Mar 30, 2021 · 8 comments
Open

virtualnev name not showing. #210

pradhanvickey opened this issue Mar 30, 2021 · 8 comments

Comments

@pradhanvickey
Copy link

pradhanvickey commented Mar 30, 2021

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
Copy link

eusojk commented Jun 30, 2021

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

@shelfofclub
Copy link

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
Copy link
Contributor

I created this PR to show Virtual Env on the Sirup theme: #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
Copy link

joaco18 commented Jul 10, 2022

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
Copy link
Contributor

@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 the sirup theme does not show the virtualenv path simply because sirup does not support it. But, I don't think this applies to your case because agnoster and powerline themes seemed supposed to support it.

Q2. What is the result of the following command?

$ declare -p VIRTUAL_ENV

@joaco18
Copy link

joaco18 commented Jul 12, 2022

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
Copy link
Contributor

akinomyoga commented Jul 12, 2022

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
Copy link
Contributor

I have rebased #282 and reverted unrelated changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants