From 4fe1bf223cd137226849d090842c4f86e4f0da03 Mon Sep 17 00:00:00 2001 From: Dan Ryan Date: Sat, 14 Oct 2017 03:06:59 -0400 Subject: [PATCH] Add enviroment context for compat shell --- pipenv/cli.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/pipenv/cli.py b/pipenv/cli.py index 817f467c..f8b07cd6 100644 --- a/pipenv/cli.py +++ b/pipenv/cli.py @@ -2024,14 +2024,18 @@ def do_shell(three=None, python=False, fancy=False, shell_args=None): terminal_dimensions = get_terminal_size() try: - c = pexpect.spawn( - cmd, - args, - dimensions=( - terminal_dimensions.lines, - terminal_dimensions.columns + with temp_environ(): + if PIPENV_VENV_IN_PROJECT: + os.environ['WORKON_HOME'] = project.project_directory + + c = pexpect.spawn( + cmd, + args, + dimensions=( + terminal_dimensions.lines, + terminal_dimensions.columns + ) ) - ) # Windows! except AttributeError: