Search code examples
fish

Stop sourcing a file


I have deleted phpbrew and now having this error when starting up the terminal:

source: Error encountered while sourcing file “/home/machine/.phpbrew/phpbrew.fish”: source: No such file or directory

How do I get a list of all sourced files and stop sourcing a certain file?


Solution

  • There is no way in general to get a list of all sourced files. Such information isn't recorded in any single place, or even multiple, places that can be checked with 100% certainty you didn't overlook one. However, in this case that probably isn't necessary since it is almost certainly going to be due to a source command run from your fish config script or a script it runs. So

    cd ~/.config/fish
    grep source **.fish
    grep '\. ' **.fish
    

    The latter because . is an alias for source. You may not find source phpbrew.fish because that script may be sourced by a plugin manager like fisherman or oh-my-fish. In which case it might be loaded indirectly by the plugin manager.