-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
break Python virtualenv display #57
Comments
My workaround for this issue is to use function prompt_command {
PS1="$(echo $PS1 | sed 's/>.*/>/') $(__posh_git_echo)\n$ "
}
PROMPT_COMMAND=prompt_command;$PROMPT_COMMAND My PS1 is defined like this (notice the PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w> ' Another advantage of this technique is that it keeps your previous PS1 customizations (if any) but keep in mind that it will break if the delimiter character appears before in the PS1, for instance in the path. It should not appear too often if you carefully choose your delimiter. |
There are also some other neat suggestions in this SO question that may help. Virtualenv modifies the shell prompt, so some elbow grease is required to make sure only at most one tool modifies |
Been a while, but this tool is still very nice. I have come up with a workaround for this problem. Just use an additional function in the RC to 'enhance' the prompt. Use the following: getBaseDir () {
base_dir=""
if [[ -n "$VIRTUAL_ENV" ]]; then
base_dir+="("
base_dir+=$(basename $VIRTUAL_ENV)
base_dir+=")"
fi
echo $base_dir
}
PROMPT_COMMAND='__posh_git_ps1 "$(getBaseDir)\[\033[01;32m\] ➞ \[\033[00m\]" "" "" " ";'$PROMPT_COMMAND My prompt only consists of an arrow. In order to additionally display the ENV call |
Hi,
When you activate a Python virtualenv, posh-git-sh got the priority and I don't see the name of my virtual env on the prompt.
It is a bit annoying because I don't know if I am in my virtualenv or not.
I don't have this issue using the original powershell post-git version
I should get something like that:
I got this instead
The text was updated successfully, but these errors were encountered: