pypa / pipenv

Python Development Workflow for Humans.
https://pipenv.pypa.io
MIT License
24.88k stars 1.87k forks source link

Adapt Windows cmd prompt in pipenv launched shell #1036

Closed dalito closed 7 years ago

dalito commented 7 years ago

The standard command prompt in windows (cmd.exe) does not indicate whether I am in an pipenv-shell or not.

  1. OS Type: Win 10
  2. Python version: 2.7.14
  3. Pipenv version: 8.3.2
c:\dev_src\_pyve>cd dev_py2
c:\dev_src\_pyve\dev_py2>pipenv shell
Launching subshell in virtual environment. Type 'exit' to return.
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. Alle Rechte vorbehalten.
c:\dev_src\_pyve\dev_py2>exit
c:\dev_src\_pyve\dev_py2>

Here "dev_py2" was a pipenv-created environment with the pipfile(s).

It would be nice if pipenv could show the name of the active virtual env in the prompt like virtualenv does:

(dev_py2) c:\dev_src\_pyve\dev_py2
techalchemy commented 7 years ago

@dalito This is currently unsupported because of the way we handle environments in windows. We don't activate the virtualenv at any point, we use subshells which are managed by pew. There are a bunch of reasons for this some of which involve the not insignificant amount of overhead involved in cross-platform path/dependency/subprocess/activation/execution management for a feature that we don't really think should be used that much.1 @erinxocon covered this a bit more in #880 so I'll go ahead and close this out for now, thanks for the feedback!

1: We intend for most things to be done using pipenv run <script> rather than the traditional approach of activating environments, since the whole point of using pipenv is that it manages the dependencies and the environment together, meaning you don't have to worry about where it is or how to access it.

doaaamin269 commented 2 years ago

Great

Funi-Simushi commented 2 years ago

This is great

matteius commented 2 years ago

@Funi-Simushi and @doaaamin269 -- you are commenting on a closed issue from 5 years ago -- I am not sure what you mean, but if you need support or think something is not working right for Windows, you may need to open a new issue or provide more details. Thanks!