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

fish_add_path is not persistent #9819

Closed
xgnxs opened this issue May 29, 2023 · 3 comments
Closed

fish_add_path is not persistent #9819

xgnxs opened this issue May 29, 2023 · 3 comments
Labels

Comments

@xgnxs
Copy link

xgnxs commented May 29, 2023

fish 3.6.1
macos ventura 13.3.1
iterm2 3.4.19
fish without third-party customizations did not affect behavior.

Adding a path to $fish_user_paths using fish_add_path with default (no) args no longer permanently adds the path, the path is only added for that session/instance. According to the documentation (and what has worked in the past), all that should be needed is fish_add_path /some/path for /some/path to be permanently added to $fish_user_paths.

ex:

> fish_add_path /Applications/Postgres.app/Contents/Versions/latest/bin
> psql
psql (15.3)
Type "help" for help.

open a new tab/terminal instance

> psql
fish: Unknown command: psql

do I now need to include -g or -U when adding a path via fish_add_path?

Thank you!

@faho
Copy link
Member

faho commented May 29, 2023

Adding a path to $fish_user_paths using fish_add_path with default (no) args no longer permanently adds the path

There has not been a change here, fish_add_path defaults to a universal fish_user_paths unless the variable exists.

My guess is you have a global fish_user_paths from elsewhere, so:

What does set --show fish_user_paths say?

Alternatively you have something that resets $PATH.

@faho faho added the question label May 29, 2023
@xgnxs
Copy link
Author

xgnxs commented May 29, 2023

hmm, asdf.fish is doing something odd (I know that's a different project). I just removed source /opt/homebrew/opt/asdf/libexec/asdf.fish from my config.fish (which they say you should add in the "Fish and Homebrew" section in step 3 here: https://asdf-vm.com/guide/getting-started.html#_3-install-asdf) and now everything seems to be working as expected...

previously:

❯ set --show fish_user_paths
$fish_user_paths: set in global scope, unexported, with 8 elements
$fish_user_paths[1]: |/Users/UNAME/.asdf/shims|
$fish_user_paths[2]: |/opt/homebrew/opt/asdf/libexec/bin|
$fish_user_paths[3]: |/Applications/Postgres.app/Contents/Versions/latest/bin|
$fish_user_paths[4]: |/Users/UNAME/.cargo/bin|
$fish_user_paths[5]: |/Users/UNAME/src/scripts/python|
$fish_user_paths[6]: |/Users/UNAME/scripts|
$fish_user_paths[7]: |/opt/homebrew/sbin|
$fish_user_paths[8]: |/opt/homebrew/bin|
$fish_user_paths: set in universal scope, unexported, with 8 elements
$fish_user_paths[1]: |/Applications/Postgres.app/Contents/Versions/latest/bin|
$fish_user_paths[2]: |/Users/UNAME/.asdf/shims|
$fish_user_paths[3]: |/opt/homebrew/opt/asdf/libexec/bin|
$fish_user_paths[4]: |/Users/UNAME/.cargo/bin|
$fish_user_paths[5]: |/Users/UNAME/src/scripts/python|
$fish_user_paths[6]: |/Users/UNAME/scripts|
$fish_user_paths[7]: |/opt/homebrew/sbin|
$fish_user_paths[8]: |/opt/homebrew/bin|

and now, without source /opt/homebrew/opt/asdf/libexec/asdf.fish in ~/.config/fish/config.fish

❯ set --show fish_user_paths
$fish_user_paths: set in universal scope, unexported, with 9 elements
$fish_user_paths[1]: |/Users/UNAME/src/data| # I added this as a test
$fish_user_paths[2]: |/Applications/Postgres.app/Contents/Versions/latest/bin|
$fish_user_paths[3]: |/Users/UNAME/.asdf/shims|
$fish_user_paths[4]: |/opt/homebrew/opt/asdf/libexec/bin|
$fish_user_paths[5]: |/Users/UNAME/.cargo/bin|
$fish_user_paths[6]: |/Users/UNAME/src/scripts/python|
$fish_user_paths[7]: |/Users/UNAME/scripts|
$fish_user_paths[8]: |/opt/homebrew/sbin|
$fish_user_paths[9]: |/opt/homebrew/bin|

in any case, things do seem to be working as expected, so this issue can be closed! Thank you!

@bakotaco
Copy link

FYI the asdf issue that caused this has been solved in asdf v0.14.0. asdf.fish no longer uses $fish_user_paths, but modifies $PATH directly to avoid these kind of issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants