-
Notifications
You must be signed in to change notification settings - Fork 2k
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
What is the best way for an external application to extend fish PATH? #3170
Comments
This has recently come up for Ubuntu's snappy in https://bugs.launchpad.net/bugs/1592558, and my answer is the same: Since 2.3.0, fish reads configuration snippets in a couple of directories:
So you might want to add a fish script (ending in ".fish") there. Those directories are our equivalent of /etc/profile.d. If your directories might change, you might want to create a single file that contains one $PATH component per-line that the fish and the sh script then read (unless you really want to support newlines in your $PATH, in which case you could separate the components with ":" or NULL). Would that work for you? |
Would using these directories work in MacOS? |
Sure, why would it not? I mean there you could also use /etc/paths.d, which we already read, but this solution is platform-agnostic. One caveat just appeared to me, though: Since $PATH is exported (and pretty much has to be), if you launched a fish inside another fish, you'd double-add your components. So you probably want to guard it with |
All of those directories would even work on OS X running by the self-contained .app bundle? |
@floam: I have no idea how the bundle thing is configured. What's $__fish_datadir and $__fish_sysconfdir in that thing? The $HOME part should still work - it still has access to the system, after all. |
I am not near a computer but I recall they are defined in terms of the result of |
Here's what fish.app is ending up with on my system that also has fish installed by other means:
You will need to install stuff into @ridiculousfish Is it intended that |
I'm not an OS X developer, just a long time user, but isn't the usual place to put local config data in $HOME/Library/Application Support/$AppName? Or possibly without the $HOME component. I have both on my system and it's not obvious what the latter is for. The $HOME based path has a lot more content; including things as the iTerm2 dynamic profile config file I created to customize my base profiles based on whether I'm running on my home server with dual 24" monitors or my laptop. |
I figured out the problem with the help dir. It's the same problem that is causing #3140. |
@krader1961 Basically, yes. A mapping in Traditionally the system Library, Just FYI, if you're looking for configuration files for an arbitrary Mac app you have on your system there are other places you might look: You may have noticed that a number of apps on your machine have migrated data out of |
@gnzlbg: I'm assuming that answers your question. If you have any more, feel free to ask! |
What about editing the |
@awelkie: If you have another software project that wishes to change something about $PATH for fish, you should do what is described here. That's what this issue is about. If you, as a user, wish to change $PATH persistently, you can use $fish_user_paths - that's what #527 is about. |
I think I would like a fish command that anybody could call to add something to the PATH permanently. |
There is |
There is this issue in rusup (the rust toolchain installer) about supporting the fish shell:
rust-lang/rustup#478 (comment)
After installation it says:
After installation it updates the PATH variable in
.profile
but fish doesn't read it (so the next time an user using fish shell logs in cargo, rust package manager, won't be in the user's PATH). Since fish is a very popular shell it would be nice if rustup could support it nicely.What would be the right way for this kind of tool to:
set -x PATH ...
(without appending$PATH
to it)? (in that case the user would need to update it manually)~/.config/fish/config.fish
and addset PATH ~/.cargo/bin $PATH
).The text was updated successfully, but these errors were encountered: