Skip to content

Commit

Permalink
Remove linuxbrew from path when detecting shell
Browse files Browse the repository at this point in the history
Addresses issue: pypa#6197

This updates the check to only look at the path after linuxbrew if it is
present.
  • Loading branch information
JoshStern committed Jul 29, 2024
1 parent c6d7aba commit 5f11189
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pipenv/shells.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ def _get_activate_script(cmd, venv):
This is POSIX-only at the moment since the compat (pexpect-based) shell
does not work elsewhere anyway.
"""

# Split on linuxbrew in case users have installed there shell using it.
# Otherwise the `nu` substring will trigger the nu shell path.
cmd = cmd.split(".linuxbrew")[-1]

# Suffix and source command for other shells.
# Support for fish shell.
if "fish" in cmd:
Expand Down

0 comments on commit 5f11189

Please sign in to comment.