Created
March 26, 2026 12:07
-
-
Save yeiichi/f7c4e3fce8b9c69d9698cff7cd9d1d0d to your computer and use it in GitHub Desktop.
Configures a dynamic Zsh prompt that displays the current Python virtual environment name without breaking standard formatting
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Set up the prompt | |
| # 1. This MUST be here for the $(...) or ${...} to work | |
| setopt PROMPT_SUBST | |
| # 2. Tell the venv script not to mess with the prompt | |
| export VIRTUAL_ENV_DISABLE_PROMPT=1 | |
| # 3. The prompt string (no spaces inside the parentheses) | |
| PROMPT='${VIRTUAL_ENV:+(${VIRTUAL_ENV:t}) }%m:%1~ %# ' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment