Python Virtual Environment - Prompt Prepended with virtual env name #390
|
Hi. Thanks guys your works are awesome. Could anyone please help with below marked text to disable I just want the Theme Virtual env Prompt nothing else. Terminal: Windows Terminal |
Replies: 11 comments 26 replies
|
Did you follow the install guide to set the prompt in your powershell profile? What does it look like? |
|
@jiaulislam that's controlled by what's in the activate script. If you look at its content, there should be a switch to disable prepending the prompt (they hijack the current prompt). Depending on the type of virtual env you either need |
|
EDIT: I didn't read well the reply for @JanDeDobbeleer. I was trying to put the env. variable VIRTUAL_ENV_DISABLE_PROMPT in the PW profile but I had to place it in the activate ps1 file of the venv folder. But I managed to make this universal for any new virtualenv created and not only the virtualenv of an actual project. Just have to put VIRTUAL_ENV_DISABLE_PROMPT in I Hope it helps for anyone! Hi! Where do I have to put VIRTUAL_ENV_DISABLE_PROMPT=1? I putted in my ps1 profile file after the theme import but it didn't work. Like this:
Thanks in advance :D |
|
Hello, awesome work, Thank you |
|
Hello |
|
conda config --set changeps1 False |
|
Hi thanks for your input, could you help me to be able to see my surroundings every time I activate it in my power shell console please. When I run conda activate testEnvironmentCreation1 in my terminal does not appear: I have noticed that the environment is not activated My profile file is as follows: Could you show me how to find the json file, which modification would be the correct one to be able to visualize when activating and deactivating virtual environments. Thank you |
|
For Pixi it's configurable under shell in the config.toml |
|
Since v24.18.1 oh-my-posh handles it by default. So now I remove my VIRTUAL_ENV_DISABLE_PROMPT env (important to remove it, setting to 0 is not enough). |















@jiaulislam that's controlled by what's in the activate script. If you look at its content, there should be a switch to disable prepending the prompt (they hijack the current prompt). Depending on the type of virtual env you either need
export PYENV_VIRTUALENV_DISABLE_PROMPT=1,VIRTUAL_ENV_DISABLE_PROMPT=1or something different. Best to look at what's in the script on your end ;-)