Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

profile.d: Do not destroy XDG_DATA_DIRS in fish #5123

Merged
merged 1 commit into from
Oct 14, 2022
Merged

Conversation

jtojnar
Copy link
Contributor

@jtojnar jtojnar commented Sep 27, 2022

The profile script previously nuked XDG_DATA_DIRS and then “helpfully” re-populated it with FHS paths. This was especially bad for systems like NixOS, which do not have /usr and rely on XDG_DATA_DIRS heavily.

Quoting from https://fishshell.com/docs/current/cmds/set.html

If a variable is set to zero elements, it will become a list with zero elements.

And indeed, that is what the set -x --path XDG_DATA_DIRS command does. We need to list the value explicitly, if we want to preserve it while setting variable options.

@jtojnar
Copy link
Contributor Author

jtojnar commented Sep 27, 2022

Verified that the patch fixes the issue with 1.14.0.

The profile script previously nuked `XDG_DATA_DIRS` and then
“helpfully” re-populated it with FHS paths. This was especially
bad for systems like NixOS, which do not have `/usr`
and rely on `XDG_DATA_DIRS` heavily.

Quoting from https://fishshell.com/docs/current/cmds/set.html

> If a variable is set to zero elements, it will become a list with zero elements.

And indeed, that is what the `set -x --path XDG_DATA_DIRS` command does.
We need to list the value explicitly, if we want to preserve it
while setting variable options.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants