fish-shell/share
Tim Riley d1be300ac7 Emulate path_helper more faithfully when constructing paths on macOS
Previously, elements already existing in the path variable would keep their position when the path was being constructed from the config files. This caused issues given that $PATH typically already contains "/usr/bin:/bin" when fish initializes within a macOS terminal app. In this case, these would keep their position at the front of the $PATH, even though the system path_helper configs explicitly place them _after_ other paths, like "/usr/local/bin". This would render binaries in "/usr/local/bin" as effectively "invisible" if they also happen to live in "/usr/bin" as well. This is not the intended

This change makes the __fish_macos_set_env config function emulate the macOS standard path_helper behavior more faithfully, with:

1. The path list being constructed *from scratch* based on the paths specified in the config files
2. Any distinct entries in the exist path environment variable being appended to this list
3. And then this list being used to *replace* the existing path environment variable

The result, for a vanilla fish shell on macOS, is that the $PATH is now set to:

    /usr/local/bin /usr/local/sbin /usr/bin /bin /usr/sbin /sbin

Where previously it was set to:

    /usr/bin /bin /usr/local/bin /usr/sbin /sbin

This new $PATH exactly matches the order of paths specified in `/etc/paths`.
2019-07-02 22:17:46 +02:00
..
completions Add FFmpeg completions (#5922) 2019-06-23 16:40:26 +02:00
functions functions/__fish_anypython: Also try python{3,2}.7 2019-06-25 19:40:22 +02:00
groff workaround broken groff man page config 2016-10-19 13:43:04 -07:00
tools Reformat all files 2019-05-05 12:09:25 +02:00
__fish_build_paths.fish.in Rename "snippets" to "conf" internally, and document them as snippets 2016-04-06 09:33:09 +08:00
config.fish Emulate path_helper more faithfully when constructing paths on macOS 2019-07-02 22:17:46 +02:00
lynx.lss Install custom LSS script to /usr/local/share/fish on make install 2017-09-26 14:31:11 -05:00