[BUG] Virtual environment indicator is not present in terminal
Describe the bug
Hi, I have created a separate virtual environment for my project. but whenever I am activating the env , no indication is showing in terminal that I am inside it. At this stage it is very risky to operate. I accidentally type any command that could break the entire os itself . for now I am using the deactivate command before using any sensitive command. Expecting fix soon, likely different theme that has an indication for virtual environment.
Steps to reproduce
- open terminal
- create a virtual environment using 'python3 -m venv ~/py3venv'
- activate the virtual environment using 'source ~/py3venv/bin/activate
- see in terminal any indication is came or not
Expected behavior
An indication for virtual environment should come.
Screenshots
Distribution
Arch Linux
If Other, specify
No response
Additional context
No response
Code of Conduct
- [x] I agree to follow this project's Code of Conduct
@Koushikg88 Thanks for testing. But in this case I need your help because I am not developing in this way. Can you check the oh-my-posh documentation and see if you can add this information to the prompt? Then you can share your results and I can add it to the dotfiles.
@mylinuxforwork Hi thanks for reply. I have gone through some options but the one partially worked for me is mentioned below:
{ "type": "python", "style": "powerline", "powerline_symbol": "\uE0B0", "foreground": "#100e23", "background": "#906cff", "template": " \uE235 {{ .Full }} {{ if .Venv }}{{ .Venv }}{{ end }}", "properties": { "fetch_virtual_env": true } },
I have added above code to the ohmyposh theme file, which is a json. I have added this inside "segments" under "blocks". `now the activated environment is showing on the right side as shown in picture. Only problem is if no virtual env is activated it still showing the default python version which i need to fix.
status without activating virtual environment:
status with virtual environment activated:
The link from where i got it is mentioned below:
https://stackoverflow.com/questions/75718484/how-can-i-see-conda-env-in-oh-my-posh-theme-in-powershell
Ok, I have restructured the theme file and the final result is shown in pic. I am sharing the theme file too.