When comparing zsh vs Homebrew, the Slant community recommends Homebrew for most people. In the question“What are the best power user tools for macOS?” Homebrew is ranked 2nd while zsh is ranked 53rd. The most important reason people chose Homebrew is:
Homebrew makes it easy for people to quickly install any open source software (that is contained within the apps repositories) for Mac.
Specs
Ranked in these QuestionsQuestion Ranking
Pros
Pro Interactive autocompletion
When you start typing a command, you can press the tab key and it will complete the command you started typing. If there are multiple potential commands, you can choose which one to run by simply pressing tab again. Case-insensitive by default, too.
Pro Powerful community-driven tools via oh-my-zsh
Oh-my-zsh is a community-driven framework, which helps users with their zsh configuration and plugins. 400 plugins, 200+ themes and auto-updates to always be up to date.
Pro Autocomplete for options
Zsh intelligently determines if you are trying to complete a file path or an option, and pressing tab after typing -
will reliably bring up a list of options.
Pro Good bash compatibility
Things you've learned using bash will largely apply to zsh. Scripts written in bash will run with little to no modification.
Pro Safer variable behaviour
Unlike Bash, zsh does not split unquoted variables by default, making it less error-prone.
Pro Recursive globbing
ls **/*.log
for example is supported by ZSH.
Pro Great install procedure
Zsh will take you through a procedure which is roughly 30 minutes in length before during install. Through this procedure it asks you to set different options and customize the shell the way you want it to. Most of these settings are also found in other shells, but to customize them you have to go dig configuration files while zsh allows you to do it in the beginning.
Pro Shared histories
If you spend a lot of time in the terminal, most likely you will have several terminal windows open. Zsh has great support for command line histories. The history is unique and shared through all the different instances.
Pro Smart escaping
Zsh can determine the context of the command you're typing in and determine if it should escape characters if you're typing in a URI.
Pro Pipe output to a temporary file:
Some programs don't support loading from stdin, but ZSH can store outputs to a temporary file, example: unzip =(curl http://example.com/someZipFile.zip)
Pro Faster spelling correction
Zsh' s correct (or correctall) is vastly superior to Bash's attempt at spelling correction.
Pro Quick access to a large repository of open source software
Homebrew makes it easy for people to quickly install any open source software (that is contained within the apps repositories) for Mac.
Pro Easy to setup and use
Once installed, you control Homebrew using the brew command. You can find packages using brew search, install them using brew install and remove them using brew uninstall.
Pro Open Source
Pro Less maintenance than Macports
Macports seems to be able to get into a bad state where new packages are unable to be installed, or installed software was unable to be updated. This simply hasn't happened with Homebrew. In addition to not having to deal with corruption problems, Homebrew installs packages in userland. Not requiring root to install software is a big win.
Pro Builds quickly and requires few dependencies
Homebrew as much as possible uses already existing libraries and tools to install software thus making builds quick and requiring few dependencies.
Pro Unintrusive
Homebrew installs packages to their own directory and then symlinks their files into /usr/local
. Homebrew won’t install files outside its prefix, and you can place a Homebrew installation wherever you like.
Pro Does not require using sudo
One of the things to like about Homebrew is that it refuses to run things under sudo
most of the time. This is a great policy, but it causes issues when you want to create symlinks or install in places that SIP has changed permissions on.
Pro Homebrew tries very hard to use existing tools and libraries
Homebrew’s recipes try very hard to use the existing tools and libraries in OS/X, so they tend to build much faster and require fewer dependent libraries.
Cons
Con Not fully compatible with bash
There is a small chance you may have a bash script that doesn't work in zsh, although this is very very rare and most developers will never run into any issues.
Con Requires a lot of configuration to be used fully
Zsh requires a lot of tinkering with configuration files and downloading plugins in order to be able to do tasks which other shells may be able to do out of the box.
Con Defaults are unfriendly for a long-time bash user
Expect to find a configuration you like (or use the configuration utility) to set reasonable preferences. Default zsh interaction is different enough to make you stutter through what used to be familiar workflows.
Con May cause issues when trying to create symlinks or installing in places where SIP has changed permissions
One of the things to like about Homebrew is that it refuses to run things under sudo
most of the time. This is a great policy, but it causes issues when you want to create symlinks or install in places that SIP has changed permissions on. (Alternatively, you could install Homebrew somewhere other than /usr/local
, but that might break various packages that depend on having stuff in and relative to /usr/local/
.)
Con Command line tools for XCode required
Once xcode is installed you can install Homebrew, including new(er)/different versions of most of the build stuff that xcode-select installed, like a newer gcc, newer git, etc.