I use the Fish shell on OSX and installed brew. Now I notice everytime I start my mac I need to run the eval $(/opt/homebrew/bin/brew shellenv) command again to make it recognice brew.

I also noticed that my fish in my vs code does not recognises it untill I run the same command in vscode terminal.

Is there somewhere it is not saving my path variables or something like it?

2 Answers 2


See https://fishshell.com/docs/current/tutorial.html#startup-where-s-bashrc

You would add to to ~/.config/fish/config.fish

Or put it in a new file: ~/.config/fish/conf.d/brew.fish


If all you want to do is add /opt/homebrew/bin to $PATH, it's sufficient to run once:

fish_add_path /opt/homebrew/bin

Documentation for fish_add_path is here.

  • The Homebrew command also modifies a couple of other variables. See env -i HOME=$HOME /opt/homebrew/bin/brew shellenv fish for what it does.
    – Kusalananda
    Commented Nov 3, 2023 at 9:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .