2

Having been confronted to a minor bug on Apple Terminal, I followed naively an advice on an internet website recommending to update my shell zsh to latest version, using brew. Which I did. (and it did not solve the bug)

But now, I realise I have two versions of it.

The regular Apple one in /bin/zsh (5.8.1) and a new one in /usr/local/bin/zsh which redirects to /usr/local/Cellar/zsh/5.9/bin/zsh

Is there a downside in uninstalling the brew-installed version again?

0

2 Answers 2

2

In general, macOS doesn't care about custom-installed shells (I'm running a Homebrew-installed bash as my login shell since years), so there is no downside in keeping both versions installed, have shell scripts use /bin/zsh and use /usr/local/bin/zsh as your login shell in Terminal.

If you want to uninstall it anyway,

  • check for any shell scripts starting with !#/usr/local/bin/zsh and change the she-bang back to #!/bin/zsh,
  • check whether you set /usr/local/bin/zsh as your shell in Terminal or in any other application (e.g. BBEdit or Visual Code), and set it back to the standard version,
  • check whether you changed your login shell with chsh and set it back to the standard version with chsh -s /bin/zsh,
  • remove /usr/local/bin/zsh from /etc/shells if you had added it there,
  • uninstall with brew uninstall zsh.
1
  • I've done as said
    – Hugues
    Commented Nov 11, 2023 at 21:17
-2

This is a downside of not uninstalling the brew-installed version:

The $PATH variable which defines where your command is looked for, /usr/local/bin is usually explored before /bin. (the default in etc/paths)

This means that your personalised version of zsh will always be called by default in every bit of code or application that is calling directly for zsh.

This includes applications that do not have configuration parameters for zsh (e.g BBEdit), every application that have a default setting to use the default system zsh (e.g Terminal), every line of code with a direct call to zsh (there can hundreds of them depending on what you do)

As a consequence, you need to be pretty sure of what you do when using your own version installed by brew, including updating it manually to stay state of the art, including the case when you upgrade your Mac OS system and it updates the default zsh version without you being aware of it.

If you are using zsh casually, especially if you want to debug problems you are coming across with zsh, it is likely easier to work with the default version of the OS.

You must log in to answer this question.

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