Hacker News new | ask | show | jobs
by ElijahLynn 1940 days ago
FINALLY!!!!!!

A new "fish_add_path" helper function to add paths to $PATH without producing duplicates, to be used interactively or in config.fish (#6960, #7028). For example:

fish_add_path /opt/mycoolthing/bin

will add /opt/mycoolthing/bin to the beginning of $fish_user_path without creating duplicates, so it can be called safely from config.fish or interactively, and the path will just be there, once.

1 comments

YES. Just couple days ago I've mangled `config.fish` with wrong use of `$fish_user_path` and was wondering why my shell started throwing errors of `$PATH` being too long, which duplicated itself to infinity and beyond. That's what you get when you don't read the docs fully.