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

terminal prompt doesn't show you're in the venv #269

Closed
davebryson opened this Issue Mar 13, 2017 · 7 comments

Comments

Projects
None yet
2 participants
@davebryson
Copy link

davebryson commented Mar 13, 2017

I'm on OS X Sierra running pipenv 3.5.2. Everything seems to work correctly. But when dropping into shell:pipenv shell I get Launching subshell in virtual environment... However the terminal prompt doesn't change to show I'm in the virtual environment - looks like my normal terminal prompt. Examples I see in the doc, look like the prompt should change as it does in virtualenvironment. Is there a configuration setting I'm missing? Thanks

@davebryson davebryson changed the title shell doesn shell doesn't show your in the venv Mar 13, 2017

@davebryson davebryson changed the title shell doesn't show your in the venv terminal prompt doesn't show you're in the venv Mar 13, 2017

@nateprewitt

This comment has been minimized.

Copy link
Member

nateprewitt commented Mar 13, 2017

Hey @davebryson, are you using a shell other than the standard bash configuration provided on Sierra? When you're in the pipenv shell can you tell me what the value of $WORKSPACE is? Thanks!

@davebryson

This comment has been minimized.

Copy link

davebryson commented Mar 13, 2017

I'm using Bash. I've customized PS1 and LDCOLORS in my .bash_profile. Running echo $WORKSPACE from within the pipenv shell returns nothing - no output. Before trying pipenv I had been using virtualenv with the same shell and it would alway show the proper virtualenv ok.

@nateprewitt

This comment has been minimized.

Copy link
Member

nateprewitt commented Mar 13, 2017

Ok, one more test for me if you wouldn't mind. Could you tell me if pew workon <virtualenv-name> does anything to your prompt? pipenv --venv will give you the path to your actual virtualenv and you'll need to use the directory name after the final / for <virtualenv-name>.

e.g. pew workon myProject-FwtTidye

@nateprewitt

This comment has been minimized.

Copy link
Member

nateprewitt commented Mar 13, 2017

If that doesn't work, pipenv shell -c should fix your issue. This appears to be a dupe of a conflict we've previously found with pew.

@davebryson

This comment has been minimized.

Copy link

davebryson commented Mar 13, 2017

Starting from a fresh terminal I ran pew workon sample-m7t5mATO where sample-m7t5mATO is the virtualenv-name created by pipenv. It does not change my prompt to show the virtualenv and outputs:
Launching subshell in virtual environment. Type exit or ctrl-D to return
Be aware that this environment will be nested on top of sample-m7t5mATO

But yes pipenv shell -c works as expected!

@nateprewitt

This comment has been minimized.

Copy link
Member

nateprewitt commented Mar 13, 2017

Ok great, I'll leave a link to berdario/pew#77 here which has instructions for configuring your shell to work with pew. I'm not necessarily recommending this, but rather leaving this here as an FYI for future readers. Pipenv uses pew by default and is subject to how they handle terminal interactions. pipenv shell -c bypasses pew here, but that also means you lose some of the advantages of pew.

Choose whichever option fits your needs best 😊. Glad you have things working now @davebryson!

@davebryson

This comment has been minimized.

Copy link

davebryson commented Mar 13, 2017

Thanks for the quick response and great work on pipenv!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment