Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not enter pipenv shell when creating new terminal directly in a pipenv folder #20

Open
danielcompton opened this issue Jul 5, 2018 · 5 comments
Labels

Comments

@danielcompton
Copy link

If I create a new terminal tab, it inherits the previous tabs location. If I do this in a pipenv folder, the original terminal gets the pipenv shell applied (from cding into it), but the new tab opened directly in that folder doesn't.

@ParthS007
Copy link
Contributor

Closing due to inactivity 👍

@lig
Copy link

lig commented Apr 12, 2019

@ParthS007 I don't understand why this one is closed

@lig
Copy link

lig commented Apr 12, 2019

Affects me as well. Opening a new terminal directly in a folder which has Pipfile doesn't activate the pipenv shell. Typing cd . after that activates pipenv shell as expected.

It is expected to have pipenv shell to be activated when fish has been started directly in a folder containg Pipfile.

@rahul286
Copy link

rahul286 commented Apr 1, 2022

Update

I had to roll back the change as it was messing up the PATH order as below (brew python was accessible before pipenv python in pipenv shell)

❯ which -a python
/opt/homebrew/opt/python/libexec/bin/python
/Users/rahul286/.local/share/virtualenvs/random-eAAq4JbF/bin/python

I also came here looking for a solution to this issue.

As of now I got desired behavior by editing the line

function __pipenv_shell_activate --on-variable PWD

with

function __pipenv_shell_activate --on-variable PWD --on-event fish_prompt

I believe we need to fire function __pipenv_shell_activate on some event related to a new terminal tab creation. fish_prompt does the job but it runs __pipenv_shell_activate function every time you're run any command. So it is not efficient.

@franciscolourenco
Copy link

franciscolourenco commented Oct 5, 2022

You could probably also solve this problem by calling __pipenv_shell_activate from config.fish

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants