pixegami / terminal-profile

This is my profile for UNIX (MacOS/Linux) terminals.
551 stars 157 forks source link

added code for displaying virtual environment #11

Open sir-george2500 opened 7 months ago

sir-george2500 commented 7 months ago

The problem I encountered a problem where activating my Python virtual environment didn't reflect in the shell prompt. There was no indication that the virtual environment was active. This code addresses the issue by displaying the name of the virtual environment above the shell prompt when it's activated.

Solution: The provided Zsh code resolves the issue by defining a function, venv_info(), which checks if a virtual environment is active ($VIRTUAL_ENV is set). If a virtual environment is active, it echoes a message above the prompt, indicating the name of the virtual environment. This information is displayed each time the precmd hook is triggered, just before the prompt is shown.

This modification improves the user experience by providing a clear visual indication of the active virtual environment, making it easier for the user to identify their working context.

retr0717 commented 5 months ago

is there a way to display the venv info along and before the username