Port #3263 with updates

- Allow click's editor to inherit the environment from the subprocess.
- Fixes #2747
- Supersedes, replaces, and closes #3263

Signed-off-by: Dan Ryan <dan@danryan.co>
This commit is contained in:
Dan Ryan
2019-03-11 00:34:16 -04:00
parent f347eee46e
commit df34b90fc4
+1 -3
View File
@@ -553,7 +553,7 @@ def run_open(state, module, *args, **kwargs):
EDITOR=atom pipenv open requests
"""
from ..core import which, ensure_project
from ..core import which, ensure_project, inline_activate_virtual_environment
# Ensure that virtualenv is available.
ensure_project(
@@ -573,9 +573,7 @@ def run_open(state, module, *args, **kwargs):
else:
p = c.out.strip().rstrip("cdo")
echo(crayons.normal("Opening {0!r} in your EDITOR.".format(p), bold=True))
from ..core import inline_activate_virtual_environment
inline_activate_virtual_environment()
environment={"VIRTUAL_ENV":os.environ["VIRTUAL_ENV"]}
edit(filename=p)
return 0