After installing brew, users are prompted to add the directory containing the new brew executable to their $PATH variable. However, the way Homebrew p

withfig / fig

submited by
Style Pass
2021-07-21 02:30:06

After installing brew, users are prompted to add the directory containing the new brew executable to their $PATH variable. However, the way Homebrew prompts users to do this is ambiguous (see below), and often causes the directory to be added to their $PATH variable every time they source a new terminal, rather than just once?

How do we know this? At Fig, many many users have presented us with bug reports saying Fig wasn't working. Turns out brew messing up the $PATH variable was the underlying cause.

When you install brew, you are prompted to add the directory containing the brew executable to your path. The prompt looks like this:

A large number of users just copy and paste the whole codeblock and add it to their .bashrc or .zshrc and then continue on with their lives. You should actually 1. run the line starting with echo in your current shell OR copy and paste the line starting with eval into your relevant dotfile. Copying the line starting with echo to your dotfiles ends up appending the line starting with eval to your dotfiles every time you spawn a new shell. This adds brew to your path each time. And now you see the issue.

Your $PATH is usually 5-15 lines. If you see the same line being repeated a million times, and that line contains brew, you have a problem!

Leave a Comment
Related Posts