1
0
Fork 0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-11-22 13:50:09 +00:00
ohmyzsh/plugins/virtualenv/virtualenv.plugin.zsh
Andrew Grangaard 894e1caa0a virtualenv cleanup: replaces subshell with prompt expansion.
* :t parameter expansion returns the last portion of the path,
  equivalent to basename. I <3 zsh.
* adds comments for the VIRTUAL_ENV_DISABLE_PROMPT,
  used by virtual_env activate

See also:
  http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion
2013-06-08 11:36:33 -07:00

8 lines
228 B
Bash

function virtualenv_prompt_info(){
if [[ -n $VIRTUAL_ENV ]]; then
printf "%s[%s] " "%{${fg[yellow]}%}" ${${VIRTUAL_ENV}:t}
fi
}
# disables prompt mangling in virtual_env/bin/activate
export VIRTUAL_ENV_DISABLE_PROMPT=1