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

Add support for disabling configuration #1256

Closed
ZyX-I opened this issue Jan 21, 2014 · 9 comments · Fixed by #7921
Closed

Add support for disabling configuration #1256

ZyX-I opened this issue Jan 21, 2014 · 9 comments · Fixed by #7921

Comments

@ZyX-I
Copy link
Contributor

ZyX-I commented Jan 21, 2014

For testing purposes it would be handy to disable loading of some configuration files. I would suggest adding -R/--no-rc switch for disabling loading files from /etc and $XDG_CONFIG_HOME and -D/--no-defaults for disabling loading from /usr/share/fish.

@zanchey
Copy link
Member

zanchey commented Feb 3, 2014

--no-rc is a reasonable idea, and you can fake it to a degree by running fish with XDG_CONFIG_HOME set to /tmp or similar.

--no-defaults will result in a poorly functioning fish as much of the initialisation work is done in PREFIX/share/fish/config.fish.

@mqudsi
Copy link
Contributor

mqudsi commented May 14, 2018

I imagine --no-defaults could ignore config.fish, though I think it currently has some dependencies on other files in the share directory.

@faho
Copy link
Member

faho commented May 15, 2018

I imagine --no-defaults could ignore config.fish

Well.... maybe.

As it currently is, I wouldn't recommend it.

I've actually been running fish in this configuration - I test stuff by building via cmake, and then run it directly without installing, which leaves the prefix wrong.

b0368fd improves the situation somewhat, though there' still a bunch of stuff that I wouldn't recommend running without:

  • No $fish_function_path means no type or eval. Also no . or : (from share/config.fish).

  • Absolutely no command-not-found handler means not even an error message when a command does not exist

  • The fallback key bindings are unusably sparse - not even \x7f ("del") is bound, meaning my backspace doesn't work. Also no arrows.

I'm assuming not setting the locale or $PATH is alright.

@mqudsi
Copy link
Contributor

mqudsi commented May 15, 2018

I imagine it'd be OK to add the standard /{,usr/}{,local/}{,s}bin? Or at least /{,usr/}bin?

(I run fish directly from ./build/fish but I also have it installed locally, so the incorrect paths end up resolving anyway.)

@faho
Copy link
Member

faho commented May 15, 2018

I imagine it'd be OK to add the standard /{,usr/}{,local/}{,s}bin? Or at least /{,usr/}bin?

Not $PATH, that's just inherited and usually okay. $fish_function_path, which is what fish uses to find its functions.

(Though yes, we would have to think about universal variables like $fish_user_paths)

@faho
Copy link
Member

faho commented May 16, 2018

Wow, that was quite confused of me!

Let me try that again:

We do the following things to $PATH in share/config.fish:

  • Add /usr/xpg4/bin on Solaris (does fish currently work on Solaris?)

  • $fish_user_paths

  • Read /etc/paths if "path_helper" exists

In addition, if $PATH is unset/empty, we set it to "/usr/bin" and "/bin" in C++. If it contains anything, we don't manipulate it.

I imagine it'd be OK to add the standard /{,usr/}{,local/}{,s}bin?

I don't think I've heard of those being missing by accident, so I don't think that'd really help. Plus hardcoding would make it quite hard to remove on purpose.

I took the same approach when it came to setting the locale - we only do that if none of the locale vars is defined, even though I strongly suggest running at least with UTF-8 encoding.

faho added a commit that referenced this issue May 17, 2018
DEL (aka backspace) and the arrows.

This makes fish usable without binding functions, though not pleasant.

See #1256.
@Jomik

This comment has been minimized.

@mqudsi
Copy link
Contributor

mqudsi commented Dec 25, 2018

See #5417

@rdorbala
Copy link

rdorbala commented Nov 14, 2020

+1 for this.
I want to launch swaywm using a startup ~/.config/fish/conf.d/sway.fish as described in https://github.com/swaywm/sway/wiki#login-managers
But if I also want to use standalone fish scripts with shebang line

#! /usr/bin/env fish

Probably I can work around this by transforming the scripts into fish functions

@faho faho mentioned this issue Apr 11, 2021
3 tasks
@faho faho closed this as completed in #7921 May 1, 2021
@zanchey zanchey modified the milestones: fish-future, fish 3.3.0 May 4, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants