-
Notifications
You must be signed in to change notification settings - Fork 788
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
Improve fish setup #1346
Comments
I should have read more: PR 1317 Did you already consider doing it the way I suggest above? I'd like to know reasons against it. |
@Kaylebor #1317 was merged before your issue was raised, so your suggestions above were not considered. We're happy to accept PRs for small improvements. Since the core team do not use all shells, shell-specific improvements should probably tag the contributors to those Shell code paths from prior PRs, eg, those in #1317 |
@hyperupcall Do your changes from #1524 resolve this issue any? |
It does not resolve the issue, but does make some points moot. For example, since I made the choice not to tackle this issue at the same time as #1524. Although I agree that objectively that closing this issue would make our Fish scripts more idiomatic, I thought it would be better (for me) to make such changes at least after #1351, and I would want to use Fish a bit more before making such a sweeping change (since it changes not just the behavior to arrive at the state, but the persistence of the state). So I guess these changes would be for another time. |
Please note to this fish-shell/fish-shell#9819 issue. The current asdf behavior with set # from asdf.fish
if type -q fish_add_path
if test -n "$ASDF_DATA_DIR"
fish_add_path --global --move "$ASDF_DATA_DIR/shims" "$ASDF_DIR/bin"
else
fish_add_path --global --move "$HOME/.asdf/shims" "$ASDF_DIR/bin"
end And many other utils and scripts based on adding |
Is your feature request related to a problem? Please describe
The current way that the
asdf.fish
script works is not very "fish-like":$PATH
to make sure the.asdf
folders are not duplicated; we can just use the built-infish_add_path
function for it..config/fish/fish_variables
when runningfish_add_path
.fish_add_path
is a safe way to make sure the path is in the right order..config/fish/functions
instead, as a one-time setup step.I recently ran into a problem where Ruby was using the system-provided
bundle
gem, instead of asdf; reshim did not help, and restarting the shell did not help either, as the current wrapper was not correctly prepending the folders to PATH.Describe the proposed solution
We can replace the current script with a setup file, run only once, that modifies the path and symlinks the files.
Roughly speaking, we only need 3 lines, plus a few extra to define the right variables:
Running this once is enough, it will be persisted without modifying
.config/fish/config.fish
.Future issues related to this can safely be fixed by rerunning this code.
We can replace the current wrapper with an
asdf_setup.fish
file, keeping the first half where we get the right variables, adding the lines above, and change fish instructions to tell users to just run the file once.This will also keep the user's
.config/fish/config.fish
file clean.Describe similar
asdf
features and why they are not sufficientWhen using the existing fish script, the shims path was somehow put at the end of PATH, breaking my intended Ruby installation until I manually fixed it.
Rerunning the script by restarting the fish changed nothing, a manual fix was needed.
Describe other workarounds you've considered
Modifying the script as said above, without the symlink, and using it as it is now (a simple wrapper) should still work.
Still, after looking at how fish handles configuration and functions, I consider it more appropriate to run this script only once instead, and let fish handle the specifics.
The text was updated successfully, but these errors were encountered: