On Sat, Oct 28, 2017 at 10:19 AM, Michael Stillwell <m...@beebo.org> wrote:
> PATH environment variable
>>>
>>> > fish_user_paths should only be set in a terminal, not in config.fish.
>>>
>>> Why is this?
>>>
>>
>> I got that from https://fishshell.com/docs/current/tutorial.html where
>> is says this:
>>
>> A faster way is to modify the $fish_user_paths universal variable
>> <https://fishshell.com/docs/current/tutorial.html#tut_universal>, which
>> is automatically prepended to $PATH. For example, to permanently add
>> /usr/local/bin to your $PATH, you could write:
>>
>> > set -U fish_user_paths /usr/local/bin $fish_user_paths
>>
>> The advantage is that you don't have to go mucking around in files: just
>> run this once at the command line, and it will affect the current session
>> and all future instances too. (Note: you should NOT add this line to
>> config.fish. If you do, the variable will get longer each time you run
>> fish!)
>>
> Ah, I see. I think the documentation is slightly confusing here.
> fish_user_paths can be a universal variable, but it doesn't need to be, and
> the code that processes it doesn't care whether it is or not:
>
> https://github.com/fish-shell/fish-shell/blob/
> fb8ae04f80c3a129f789e7b718464d014508315f/share/config.fish#L175-L198
> http://fishshell.com/docs/2.6/#variables-special
>
> Personally, I try to avoid universal variables, because I don't like to
> have fish state stored outside a git repo. However, I think it's safe to
> set fish_user_paths in fish/config.fish, as long as it's not a universal
> variable. At least, that's what I do! See
>
> https://github.com/ithinkihaveacat/dotfiles/blob/master/fish/config.fish
>
Why do you feel setting fish_user_paths in config.fish is preferable to
instead setting PATH in config.fish? My understanding is that the purpose
of fish_user_paths is to allow changing PATH in all current and future fish
sessions without requiring a change to config.fish. But if you know it's a
change you want in all your shells and you don't mind it only taking effect
in future shells, it seems better to just set PATH in config.fish. Isn't it
the case that if you modify the value of fish_user_paths in your
config.fish file, it won't affect current sessions?
--
R. Mark Volkmann
Object Computing, Inc.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users