topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Friday March 29, 2024, 3:34 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: MacOS Catalina switches to Z Shell  (Read 4640 times)

Edvard

  • Coding Snacks Author
  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 3,017
    • View Profile
    • Donate to Member
MacOS Catalina switches to Z Shell
« on: October 28, 2019, 02:36 AM »
My son, who is an Apple enthusiast, told me a surprising bit of news that was recently handed down in the MacOS universe.  Apparently the newest iteration of the Mac OS, Catalina, is switching to the venerable Zsh (Z Shell) as its default command line shell:
https://www.theverge...replacement-features
Apple unveiled macOS Catalina yesterday with support for iPad apps and lots of new features, but a big change for developers and power users was missing from the on stage presentation. Starting with macOS Catalina, Macs will now use zsh as the default login shell and interactive shell across the operating system. All newly created user accounts in macOS Catalina will use zsh by default. Bash will still be available, but Apple is signaling that developers should start moving to zsh on macOS Mojave or earlier in anticipation of bash eventually going away in macOS.

Most internet news sources have started asking "Why?", and come up with pretty much the same answer: That pesky GPLv3 license:
https://thenextweb.c...d-of-bash-licensing/
So, why the sudden change?
In a word: licensing.
For well over a decade, Apple has shipped macOS with a horrendously outdated version of GNU Bash. The default version on the last version of macOS, codenamed Mojave, is Bash 3.2. That dates back to 2007. For context, that’s the same year Apple unveiled the first iPhone.
...
Newer versions of Bash are licensed under the GNU General Public License version 3 – or GPLv3 for short. This comes with several restrictions which could potentially have caused a few headaches for Apple further down the line.

While that may be a *correct* answer, a few people have seen another answer that fleshes out a possibility beyond 'Muh License': the mighty 'Oh My ZSH' community.
https://sunlightmedia.org/bash-vs-zsh/
For one, zsh has the leverage of a powerful online community called Oh My ZSH. Oh My ZSH is one of the oldest and most popular options for managing zsh configurations. Offering over 250 plugins and 140 different themes supplied by the community, Oh My ZSH is a great place to start in customizing the z shell that even comes with an auto-update function that keeps your shell updated. This allows users to work in a shell with a more personalized interface, amp up their workspace with a diverse array of tools, and have access to a convenient out-of-the-box support system. For instance, a highly favorable option for the interface is a right-handed side prompt or a side prompt that auto-hides when typing in long file paths or commands. Even this minute level of flexibility turns developers’ heads towards zsh.

You might say "Ok, so it has a few themes and whatnot, but Bash also supports colorizing and you can write scripts, change configs and set aliases without needing 'plugins', so what gives?", and you'd be right.  Take a look at Bash-It, a self-confessed OMZ "rip-off" and you'll see it offers a similar experience, with nothing more than the afore-mentioned scripts, configs, and aliases.
But then I noticed something peculiar:  Most of the theme screenshots at the Themes page showed Zsh being used inside a Git session.  As in, instead of the prompt simply showing you what directory you're currently in, these custom prompts will show you what Git branch/node you're working in, and some of them do some downright snazzy things. 



There are plugins and themes that go beyond Git, adding autocompletion, aliases and functions for working with Mercurial, Docker sessions, and many others. So it seems Zsh (coupled with the OMZ framework) allows you to go beyond simple colorization, and into useful visual feedback while doing work in the clean environment of a shell.
That's some downright Star Trek bizniss right there.  Nice.  :Thmbsup:

So, will I be installing Zsh and OMZ on my Linux box?  I just might at that, and I'll report back my experience.