Skip to content

/etc/paths.d entries are split when containing spaces #5481

@azixMcAze

Description

@azixMcAze

Hi!
I am using Fish 3.0.0 on macOS 10.13.6

$ fish --version
fish, version 3.0.0
$ echo $version
3.0.0

I have added an entry in /etc/paths.d/ that contains a space in its path:

$ cat /etc/paths.d/jre 
/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin

This path is split on space when it is added to $PATH:

Welcome to fish, the friendly interactive shell
$ echo $version
3.0.0
$ for p in $PATH; echo $p; end
/usr/local/bin
/usr/bin
/bin
/usr/sbin
/sbin
/Applications/Android
Studio.app/Contents/jre/jdk/Contents/Home/bin

However, this was not the case with fish 2.7.1:

Welcome to fish, the friendly interactive shell
$ echo $version
2.7.1
$ for p in $PATH; echo $p; end
/usr/local/bin
/usr/bin
/bin
/usr/sbin
/sbin
/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin

path_helper does not split the entries on spaces:

$ /usr/libexec/path_helper
PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin"; export PATH;

I have opened a new terminal tab for each test so I think fish did not inherit a previous session's env vars.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething that's not working as intended

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions