Repository navigation
Conversation
This prevents fish from loading the user configuration file, both at startup and at any point thereafter, in both interactive and non-interactive modes. As fish relies extensively on `$__fish_config_dir` for core functionality (universal variables), this is achieved by creating a new runtime path (using the existing code to do so) to serve as the user config dir.
|
What is this for? |
|
I think to get a one-off unconfigured fish. Like, what |
|
The primary reason is that currently there's no way to distribute reproducible fish scripts. The behavior of a invoking a non-interactive fish script relies heavily on the user's Secondarily, it allows testing fish in a stock fashion without the user configuration influencing anything. More generally, it's an alternative approach to @faho's #5394, which at the very least gives the user an option of expliictly not reading |
|
Useful for cases like using |
|
Actually, our own github issue template recommends that users reproduce their issue with a clean configuration via This could also take the place of that. |
|
Okay, so this one picks $XDG_RUNTIME_DIR as config directory, thereby bypassing ~/.config/fish/config.fish. That also stops the uvars and the conf snippets in ~/.config/fish/conf.d from being read, and the functions/completions from showing up in the path variables. So far, so good. However, it also
I'm not sure about either of these. It doesn't seem like config really has anything to do with history, but I'm not sure what users typically expect here. Stopping third-party scripts from still accessing the config if you've disabled it seems like the correct thing, but I'm not sure if it's not better to allow access to the config if something really wants? What if this leads to people hardcoding ~/.config/fish? (Then again bash doesn't mask $HOME, and its config file is simply ~/.bashrc) Also, this is already a problem with env_get_runtime_path(), but $XDG_RUNTIME_DIR isn't directly usable as a fish directory. On my system it's /run/user/$uid, so fish would just directly dump /run/user/1000/fish_variables in there. This would also mean all fish processes (of the same user) running without config would share uvars, which I don't think we want? (If $XDG_RUNTIME_DIR isn't set, this uses I imagine the way to go about it is to disable uvar persistence entirely when run without config. |
Yes, I ran into that. I thought it was just a bad configuration on my end. We need to create a random directory within that folder and use that. It would be great if we had a way to delete it on exit as well.
Do you know of an easy way to do that? |
I'd recommend against that. These dirs should be cleaned up by the system if it wants. E.g. on my system /tmp and /run are on tmpfs (i.e. non-persistent) and /run is defined to be. I'm always wary of deleting anything, because if that goes wrong it goes wrong badly.
I would imagine, from a cursory reading, inhibiting Simply setting that to NULL won't work because we should still set universal variables internally (can't have |
|
With regards to the latter part of your comment: yes, and I imagine a lot of other hidden gotchas would pop up if we tried to disable certain values. So my idea was to let it read (and write) whatever it wants, just from a pristine environment. |
|
Maybe there is a different way: allow the user to specify the config locations. They could point it at |
|
Maybe fish-specific environment variables. |
I would like this more, tbh. Because it'd be a nice way to make a declarative fish installation with Nix. |
|
Unfortunately |
|
I think you'd probably want an error if you give |
|
I understand what you're saying but the blocker here isn't about where the actual config file itself ( I should explain that the entire point of this branch is to add a feature which would enable reproducible builds (among other things). Subsequent runs of fish with |
|
Closing this one for now, since there's some issues that need to be addressed before it is ready to merge. |
This prevents fish from loading the user configuration file, both at
startup and at any point thereafter, in both interactive and
non-interactive modes.
As fish relies extensively on
$__fish_config_dirfor corefunctionality (universal variables), this is achieved by creating a new
runtime path (using the existing code to do so) to serve as the user
config dir.
Either this or #5416 should be merged, depending on how far we want to take this.