-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Description
- I am on the latest Poetry version.
- I have searched the issues of this repo and believe that this is not a duplicate.
- If an exception occurs when executing a command, I executed it again in debug mode (
-vvvoption).
- OS version and name: macOS 10.15.1
- Poetry version: 1.0.0
- Link of a Gist with the contents of your pyproject.toml file: https://gist.github.com/dirn/90f7357458591b8f9a969ab66d74ec02
Issue
According to the documentation
The
shellcommand spawns a shell, according to the$SHELLenvironment variable, within the virtual environment. If one doesn't exist yet, it will be created.
Looking at Poetry's source, however, $SHELL isn't used at all. Instead, os.getpid is called and passed to the detect_shell function in a library called shellingham. If poetry shell is invoked from a subprocess, the pid could be associated with a different shell.
In my particular case, I'm using fish shell and used direnv to automatically load a Poetry shell upon entering the directory. direnv runs everything inside a bash process, causing the Poetry shell to use bash instead of fish.
bash-3.2$ . /Users/dirn/src/playground/testing/.venv/bin/activate
(.venv) bash-3.2$ echo $SHELL
/usr/local/bin/fish
(.venv) bash-3.2$ python -c "import os; print(os.getpid())"
68238
(.venv) bash-3.2$ exit
⋊> ~/s/p/testing python -c "import os; print(os.getpid())"
68242
I'd like to see the behavior match the documentation, but if there are reasons for that not to happen, the documentation should be updated instead.