Skip to content

Consider fish_add_path for PATH manipulation in shell env fish commands #482

@gwenwindflower

Description

@gwenwindflower

Currently you're setting PATH directly with rv's active ruby paths prepended, there's a lot of space for wonkiness here though (mise struggles with this at present) for fish users who use the blessed path (no pun intended) via fish_add_path. This prepends new paths to a fish_user_paths variable (default a harmless noop if the path is already in the list, though there are options for different behavior such as scooting it to the front on re-add), then prepends that list to your base PATH. It's very flexible, there are options for appending instead of prepending, etc — and it makes it very easy to reason about, robust, and fish-y (and simple code-wise) to ensure certain paths are always at the front, even if the underlying PATH changes during the session. Basically tailor-made for language runtime+package manager tools.

Perhaps this was already considered and rejected for some reason, but it's a feature a lot of non-fish users are often not aware of, so thought I'd throw it out there. I would definitely feel better about that in the env snippet over the direct PATH manipulation. Loving the tool so far though, fantastic work!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions