Skip to content
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

Current active VirtualEnv string is not being added to prompt on Windows #880

Closed
dougthor42 opened this issue Oct 11, 2017 · 1 comment
Closed

Comments

@dougthor42
Copy link

Summary

The current active venv is not prepended to the Powershell prompt on Windows.

Steps to Reproduce

  1. Run pipenv shell in some Windows directory

  2. See the shell prompt doesn't show the active venv.

    C:\project>pipenv shell
    Creating a virtualenv for this project…
    Using base prefix 'c:\\winpython35_x64\\python-3.5.2.amd64'
    New python executable in C:\WinPython35_x64\settings\.virtualenvs\notes-ZJAFqFjp\Scripts\python.exe
    Installing setuptools, pip, wheel...done.
    
    Virtualenv location: C:\WinPython35_x64\scripts\..\settings\.virtualenvs\notes-ZJAFqFjp
    Launching subshell in virtual environment. Type 'exit' to return.
    Windows PowerShell
    Copyright (C) 2016 Microsoft Corporation. All rights reserved.
    
    PS C:\project>
    

Additional Info

I think this might be an issue with how powershell defines the prompt, but I haven't been able to determine for sure.

We all know how venv prepends the activated venv string to the prompt:

CMD

C:\project>.venv-project\Scripts\activate.bat
(.venv-project) C:\project>

Bash

user@host:~/project$ . .venv-project/bin/activate
(.venv-project) user@host:~/project$

Version Info

  • Windows 10 Pro, 10.0.15063 Build 15063
  • Python 3.5.2, 64-bit (via WinPython 3.5.2.2)
  • pip 9.0.1
  • pipenv 8.2.6

Related issues

@erinxocon
Copy link
Contributor

@dougthor42 This is because on windows, pipenv uses pew by default to manage getting into and out of virtualenv's. pew doesn't change the prompt for anyone, unix or windows user, it relies on having a properly configured shell that does it for you. The activation.bat file does modify the prompt but as I said windows pipenv doesn't source that when pipenv shell is run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants