Skip to content

Add better protection to setting $PATH  #2969

@simotek

Description

@simotek

As $PATH is special in fish someone at some point decided to add some protection so that if for example you do this set -x PATH "$PATH /opt/bin" Fish will suggest that you are doing this wrong and will not update the variable.

Below are some other creative ways of breaking the path in fish, it would probably be nice to warn against them as well. I guess as a rule of thumb you could always check if at least one entry in the array is a valid path (oddly enough in openSUSE the first entry in $PATH normally doesn't exist)

'# Presume $TMP contains "$PATH /usr/local/bin" echo $TMP | read -x PATH`
or
'set -x PATH $TMP'

set -x PATH FOO

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions