1
I would like to list the name of my Python virtualenv in my ZSH prompt but I can't get it to work. It is listed as an environment variable (VIRTUAL_ENV). I've set up another script that properly returns just the basename of my virtual env (envTest) but trying to incorporate that into my prompt didn't work either.
Prompt config:
PROMPT="╭─${user_host} ${current_dir} [${VIRTUAL_ENV}] ${rvm_ruby} ${git_branch}
╰─%B${user_symbol}%b "
Console:
╭─user@server ~/Projects/virtualenvTest []
╰─$ echo $VIRTUAL_ENV
╭─user@server ~/Projects/virtualenvTest []
╰─$ source envTest/bin/activate
╭─user@server ~/Projects/virtualenvTest []
╰─$ echo $VIRTUAL_ENV
/home/user/Projects/virtualenvTest/envTest
I can get other environment variables to show up in my prompt (e.g. LANG).
Prompt config:
PROMPT="╭─${user_host} ${current_dir} [${LANG}] ${rvm_ruby} ${git_branch}
╰─%B${user_symbol}%b "
Console:
╭─user@server ~/Projects/virtualenvTest [en_US.UTF-8]
╰─$ echo $LANG
en_US.UTF-8