Shells and Distribution

Feb 28, 2023

Z shell (zsh) ships on every Mac laptop as the default shell since 2019. The best distribution that you could ask for. A few years later, what it meant for the project.

Z shell was released in 1990, only one year after the Bourne Again Shell (bash). Apple chose zsh for a few reasons, but it seems likely because Apple was stuck with an extremely old version of bash (3.2), which was the last version released under GPLv2 (the project moved to GPLv3).

ohmyzsh is the 16th most-starred repository on GitHub (156,000 stars). I wish I had more granularity on this graph to see the inflection point where it was shipped by Apple.

Interestingly the exponential growth seems to start somewhere around mid-2013. Some guesses:

  • Version 5.0 (December 2012) was a large improvement over the last generation
  • More regular updates after 2013

Adoption hasn't reached the shell scripting world, where zsh continues to lag behind other shells (although I'm unsure how much GitHub Code Search can be trusted).

  • 33.3k files with the #!/bin/zsh identifier
  • 4.7M with #!/bin/bash
  • 2.1M with #!/bin/sh