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

bug: fish path set-up breaks fish_add_path #1629

Closed
tjvc opened this issue Sep 4, 2023 · 4 comments
Closed

bug: fish path set-up breaks fish_add_path #1629

tjvc opened this issue Sep 4, 2023 · 4 comments
Labels

Comments

@tjvc
Copy link

tjvc commented Sep 4, 2023

Describe the Bug

The fish set-up script sets fish_user_paths as a global variable. This breaks the expected behaviour of this variable, which is a universal variable by default. Universal variables persist across fish sessions; global variables are specific to the current session. Global variables, when present, take precedence over universal variables of the same name. The impact of this is that users calling fish_add_path /some/path unexpectedly find that the assignment is not persisted across sessions.

This has previously been raised as an issue on fish itself, and noted as a comment on another issue in this repo, but I think it's deserving of its own issue.

Steps to Reproduce

  1. Install the asdf fish set-up script
  2. Start a fish shell
  3. Update fish_user_paths with fish_add_path /some/path
  4. Start another fish shell

Expected Behaviour

The path assignment is persisted across sessions.

Actual Behaviour

The path assignment is only applied in the current session.

Environment

OS:
Darwin XX379KM0VT 22.6.0 Darwin Kernel Version 22.6.0: Wed Jul  5 22:22:05 PDT 2023; root:xnu-8796.141.3~6/RELEASE_ARM64_T6000 arm64

SHELL:
fish, version 3.6.0

BASH VERSION:
3.2.57(1)-release

ASDF VERSION:
v0.12.0

ASDF INTERNAL VARIABLES:
ASDF_DEFAULT_TOOL_VERSIONS_FILENAME=.tool-versions
ASDF_DATA_DIR=/Users/thom/.asdf
ASDF_DIR=/opt/homebrew/Cellar/asdf/0.12.0/libexec
ASDF_CONFIG_FILE=/Users/thom/.asdfrc

ASDF INSTALLED PLUGINS:
nodejs                       https://github.com/asdf-vm/asdf-nodejs.git master c9e5df4
python                       https://github.com/danhper/asdf-python.git master 8505457
ruby                         https://github.com/asdf-vm/asdf-ruby.git master 16bc8ac
terraform                    https://github.com/asdf-community/asdf-hashicorp.git master c44c314

asdf plugins affected (if relevant)

No response

@tjvc tjvc added the bug label Sep 4, 2023
@richjdsmith
Copy link

I am in the same boat. Just stumbled on this thread today. I am new to fish so working through and figuring out what is going on is going to take time. Would appreciate if you do end up finding a solution, if you share it.

@samvv
Copy link

samvv commented Sep 10, 2023

I can confirm this is an issue. I had to remove asdf from my system because of this.

@tjvc
Copy link
Author

tjvc commented Oct 23, 2023

I am in the same boat. Just stumbled on this thread today. I am new to fish so working through and figuring out what is going on is going to take time. Would appreciate if you do end up finding a solution, if you share it.

@richjdsmith, in case this is useful to you six weeks later, I workaround this behaviour by adding the asdf paths manually in my fish config file before sourcing the set-up script:

fish_add_path "$ASDF_DIR/bin"
fish_add_path "$HOME/.asdf/shims"

if status --is-interactive && type -q asdf
  source (brew --prefix asdf)/libexec/asdf.fish
end

This works because asdf first checks whether these paths are present before setting the global variable. Ideally it wouldn't be necessary.

@jthegedus
Copy link
Contributor

Closed by #1699

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

4 participants