Paymahn Moghadasian Paymahn Moghadasian - 6 months ago 27
Bash Question

Modifying PATH with fish shell

I'm currently playing around with the fish shell and I'm having some trouble wrapping my head around how the

PATH
variable is set. For what it's worth, I'm also using oh-my-fish.

If I echo my current path I get:

➜ fish echo $PATH
/usr/local/bin /usr/bin /bin /usr/sbin /sbin /usr/local/bin /opt/X11/bin /usr/texbin /Users/myname/.opam/system/bin


Looking at
~/.config/fish/config.fish
I see the following line

set PATH /usr/local/bin $PATH /Users/myname/.opam/system/bin


My question is (and this phrasing will probably reflect my lack of knowledge on the subject): prior to
config.fish
being processed, where is the
PATH
variable set? ie: where do all of the paths between
/usr/local/bin
and
/Users/myname/.opam/system/bin
come from?

Answer

This command:

set -U fish_user_paths /usr/local/bin $fish_user_paths

This will add /usr/local/bin permanently to your path.