diff --git a/changelog.d/1346.doc.md b/changelog.d/1346.doc.md new file mode 100644 index 0000000000..8e672c8faa --- /dev/null +++ b/changelog.d/1346.doc.md @@ -0,0 +1 @@ +Add a note about sourcing the shell config file for `ensure_path` diff --git a/src/pipx/commands/common.py b/src/pipx/commands/common.py index e3651e5029..40aaabe2c4 100644 --- a/src/pipx/commands/common.py +++ b/src/pipx/commands/common.py @@ -479,7 +479,7 @@ def warn_if_not_on_path(local_bin_dir: Path) -> None: environment variable. These apps will not be globally accessible until your PATH is updated. Run `pipx ensurepath` to automatically add it, or manually modify your PATH in your - shell's config file (i.e. ~/.bashrc). + shell's config file (e.g. ~/.bashrc). """, subsequent_indent=" " * 4, ) diff --git a/src/pipx/commands/ensure_path.py b/src/pipx/commands/ensure_path.py index 6bbfcca8c9..5976a5d138 100644 --- a/src/pipx/commands/ensure_path.py +++ b/src/pipx/commands/ensure_path.py @@ -84,7 +84,8 @@ def ensure_path(location: Path, *, force: bool) -> Tuple[bool, bool]: f""" {location_str} has been been added to PATH, but you need to open a new terminal or re-login for this PATH change to take - effect. + effect. Alternatively, you can source your shell's config file + with e.g. 'source ~/.bashrc'. """, subsequent_indent=" " * 4, ) @@ -140,7 +141,8 @@ def ensure_pipx_paths(force: bool) -> ExitCode: pipx_wrap( """ You will need to open a new terminal or re-login for the PATH - changes to take effect. + changes to take effect. Alternatively, you can source your shell's + config file with e.g. 'source ~/.bashrc'. """ ) + "\n"