Skip to content

Commit

Permalink
Check end of path for shell detection
Browse files Browse the repository at this point in the history
Addresses issue: pypa#6197

Previously these branches would trip if the shell name was present
anywhere in the cmd path. This updates the check to only look at the
end.
  • Loading branch information
JoshStern committed Jul 29, 2024
1 parent c6d7aba commit f209213
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions news/6197.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update shell detection to only check the end of the command used.
8 changes: 4 additions & 4 deletions pipenv/shells.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,17 @@ def _get_activate_script(cmd, venv):
"""
# Suffix and source command for other shells.
# Support for fish shell.
if "fish" in cmd:
if cmd.endswith("fish"):
suffix = ".fish"
command = "source"
# Support for csh shell.
elif "csh" in cmd:
elif cmd.endswith("csh"):
suffix = ".csh"
command = "source"
elif "xonsh" in cmd:
elif cmd.endswith("xonsh"):
suffix = ".xsh"
command = "source"
elif "nu" in cmd:
elif cmd.endswith("nu"):
suffix = ".nu"
command = "overlay use"
else:
Expand Down

0 comments on commit f209213

Please sign in to comment.