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

Add support for an --all-shells flag for ensurepath #1585

Open
gh271 opened this issue Dec 6, 2024 · 0 comments
Open

Add support for an --all-shells flag for ensurepath #1585

gh271 opened this issue Dec 6, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@gh271
Copy link

gh271 commented Dec 6, 2024

How would this feature be useful?

I have an install script containing pipx ensurepath. This script has a #!/bin/bash shebang, meaning pipx is always added to $PATH in Bash. However, if someone using a shell other than Bash runs this script, the path is still only added to Bash. MacOS for example uses zsh by default.

An --all-shells flag for pipx ensurepath would be useful in my install script since pipx could then be added to all shells' $PATH, regardless of which the user uses.

I came across the following issue: #1290, which would be solved by an --all-shells flag I think.

Describe the solution you'd like

pipx uses the prepend() and append() functions from the userpath library. Both of these functions support an all_shells argument, which when set to True, sets the path for a list of pre-defined shells (https://github.com/ofek/userpath/blob/master/userpath/shells.py). This means it should be very easy to add an --all-shells flag.

I will create a PR for this. But I would obviously like to hear if you think this is a good idea!

Describe alternatives you've considered

I have not considered any alternative.

@dukecat0 dukecat0 added the enhancement New feature or request label Dec 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants