Skip to content

Add support for disabling configuration #1256

Closed

Description

@ZyX-I

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.

Activity

  1. zanchey commented on Feb 3, 2014

    @zanchey
    Member

    --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.

  2. mqudsi commented on May 14, 2018

    @mqudsi
    Contributor

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

  3. faho commented on May 15, 2018

    @faho
    Member

    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.

  4. mqudsi commented on May 15, 2018

    @mqudsi
    Contributor

    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.)

  5. faho commented on May 15, 2018

    @faho
    Member

    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)

  6. faho commented on May 16, 2018

    @faho
    Member

    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.

  7. added a commit that references this issue on May 17, 2018
  8. Jomik commented on Dec 25, 2018

    @Jomik
  9. mqudsi commented on Dec 25, 2018

    @mqudsi
    Contributor

    See #5417

  10. rdorbala commented on Nov 14, 2020

    @rdorbala

    +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

  11. modified the milestones: fish-future, fish 3.3.0 on May 4, 2021
  12. locked as resolved and limited conversation to collaborators on May 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions