-
Notifications
You must be signed in to change notification settings - Fork 2.3k
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Ctrl+C exits poetry shell
in Fish shell
#823
Comments
I can reproduce this on Arch with these versions: poetry: 0.12.12 Edit: I did some digging through the Pipenv source code, and it looks like they launch a shell using Here's a reproduction: import os
import subprocess
SHELL_PATH = '/usr/bin/fish'
if __name__ == '__main__':
print('spawning new shell')
# Ctrl+C will kill this shell:
subprocess.call([SHELL_PATH])
# Ctrl+C will not kill this shell:
os.execvp(SHELL_PATH, ['-i']) Here's how Pipenv launches a shell: def _handover(cmd, args):
args = [cmd] + args
if os.name != "nt":
os.execvp(cmd, args)
else:
sys.exit(subprocess.call(args, shell=True, universal_newlines=True)) |
temporary workaround which i found (is not so good since it have python version hardcoded): function poetry_shell
source $HOME/.cache/pypoetry/virtualenvs/(basename $PWD)-py3.7/bin/activate.fish
end UPD: or could be like that but still not fine if you have projects using non-default version: function poetry_shell
source $HOME/.cache/pypoetry/virtualenvs/(basename $PWD)-py(python --version | grep -o '[0-9].[0-9]')/bin/activate.fish
end |
@jhrmnn This was fixed in 1.0.0b2 by making the change I mentioned above |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Issue
When the Poetry shell is launched with
poetry shell
under the Fish shell, Ctrl+C exits the Poetry shell. This doesn't happen when launched from Bash. I would expect that Ctrl+C does nothing. I ended up not usingpoetry shell
, but rather sourcing theactivate.fish
from the virtual environment, but that is a bit more cumbersome, because it's not directly accessible as a Poetry command.The text was updated successfully, but these errors were encountered: