From 7ce51159f4846590d50b844a69b36cf31c7d1785 Mon Sep 17 00:00:00 2001 From: Nate Prewitt Date: Wed, 1 Mar 2017 09:08:59 -0700 Subject: [PATCH] Only spawn shell once --- pipenv/cli.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pipenv/cli.py b/pipenv/cli.py index 400ada6e..19dd947c 100644 --- a/pipenv/cli.py +++ b/pipenv/cli.py @@ -868,6 +868,10 @@ def shell(three=None, python=False, compat=False, shell_args=None): # Ensure that virtualenv is available. ensure_project(three=three, python=python, validate=False) + if 'PIPENV_ACTIVE' in os.environ: + click.echo(crayons.yellow('Shell already activated. No action taken to avoid nested environments.')) + return + # Set an environment variable, so we know we're in the environment. os.environ['PIPENV_ACTIVE'] = '1'