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

Configuration not evaluated when invoking fish with -c #7620

Closed
eaigner opened this issue Jan 11, 2021 · 3 comments
Closed

Configuration not evaluated when invoking fish with -c #7620

eaigner opened this issue Jan 11, 2021 · 3 comments

Comments

@eaigner
Copy link

eaigner commented Jan 11, 2021

I tried to evaluate env like this

env -i /usr/local/bin/fish -l -i -c env

The env -i prefix is required for this test to prevent inheriting my local environment.

This should output the environment of a fresh fish interactive login shell, however, it doesn't seem fish evaluates any configuration at all.

Any user PATHs configured in config.fish or fish_variables do not show up in the PATH= line of the output.

System:

fish, version 3.1.2
macOS Big Sur 11.1 (20C69)
@faho
Copy link
Member

faho commented Jan 11, 2021

Fish always reads config.fish, even in non-interactive and non-login shells.

Your problem is that env -i also erases $HOME, so fish won't find config.fish, so try

env -i HOME=$HOME /usr/local/bin/fish -l -i -c env

@faho faho added the question label Jan 11, 2021
@eaigner
Copy link
Author

eaigner commented Jan 11, 2021

You sir, are correct!

@eaigner eaigner closed this as completed Jan 11, 2021
faho added a commit that referenced this issue Jan 11, 2021
They are based on $HOME, so setting $HOME has to be done first.

Fixes #7620

(untested because I'm assuming common CI systems have weird $HOME settings)
@faho
Copy link
Member

faho commented Jan 11, 2021

On second look, we already try to figure out $HOME and $USER, but we do it a bit too late - after determining the config path.

Simply doing that earlier means this can be worked around - not that I recommend starting fish with an unset $HOME.

@faho faho added enhancement and removed question labels Jan 11, 2021
@faho faho added this to the fish 3.2.0 milestone Jan 11, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants