Live data from Hacker News

Use zsh as the default shell on your Mac

support.apple.com

61–70 of 252 posts

Re: Use zsh as the default shell on your Mac

#61

Earlier quoted context omitted.

I don't understand why GPLv3 would be a problem on macOS. On macOS, you can run anything out of the box (depending on security/gatekeeper settings) and you can replace or modify system executables (such as /bin/bash) if you turn off SIP (which is slightly tricky to do but can be done from recovery mode.) Running your own customized /usr/local/bin/bash is easy of course, and package managers like MacPorts or Brew make…

Did you notice how many qualifiers you had there? The trend on macOS is clear: harder and harder to run/do anything that isn't blessed by Apple.

SIP and Gatekeeper and one-time commands. I find disabling SIP to be much less painful than enabling unsigned drivers in Windows.

I wouldn't even classify turning off SIP as "slightly tricky". You boot into recovery mode, open the terminal, type in two words, and press enter.

Besides, this is separate from the GPLv3 question. You can absolutely recompile bash and replace macOS's version with your own, so I don't understand why this is a problem for Apple.

Re: Use zsh as the default shell on your Mac

#62
post #5

Guess they had to go somewhere as Apple's unwillingness to have GPLv3 code effectively killed off bash updates. Slightly disappointed, but guess they had to go somewhere and zsh is going to be well supported going forward

??? # change default shell to newer brew'ed bash brew install bash && sudo dscl . change /users/$USER UserShell /bin/bash /usr/local/bin/bash # change default shell to newer brew'ed zsh brew install zsh && sudo dscl . change /users/$USER UserShell /bin/bash /usr/local/bin/zsh

What's your ???

That's homebrew, not Apple.

Re: Use zsh as the default shell on your Mac

#64

Maybe I’m imagining things, but wasn’t zsh also the default until MacOS 10.4 or so? Edit: I was misremembering things. tcsh until 10.3.

zsh was the default sh until OS X 10.2 or 10.3. However, the zsh version was quite out of date (3.x when 4.x was already mature/stable, IIRC). A horse race between the old zsh and the latest bash was jiggered to show bash as much faster, and therefore worth switching to, never mind that the then-current zsh demonstrated performance parity with bash.

Source: I was tasked with the performance comparison and (despite my objections) the conversion to bash. On the bright side, I learned a lot about zsh in the process and have used it as my shell rather than bash ever since.

Re: Use zsh as the default shell on your Mac

#65

Had no idea they were shipping zsh in newer versions. Neat! Wonder why they don't do Bash 4.x.x+ versions by default. Or, do they?

The "newer versions" are the one just announced today and releasing in September, so you're not too far behind the curve :)

Re: Use zsh as the default shell on your Mac

#66

Earlier quoted context omitted.

That’s probably more a BSD vs GNU issue, to be fair. Mac is based on FreeBSD. GNU/Linux, well... :)

To be exact, FreeBSD and macOS (based on NeXTStep) are both based on BSD, and contribute to each other. FreeBSD came out after NeXTStep was released though...

True that freebsd is more recent than NeXT, but they re-imported a lot of stuff from more recent freebsd over the years though.

Look at a bunch of Apple manpages. Many of them say FreeBSD.

Re: Use zsh as the default shell on your Mac

#68

zsh is better than bash in nearly all aspects, at least in my use cases, so this is a great news for me. Is there anything that can be done in bash but not in zsh?

zsh isn't a perfect super-set of bash (there are some differences in syntax, provided built-ins, &c.), but it does have equivalents for most of bash's functionality. Off the top of my head i can't think of anything useful that it's missing. People may have subjective preferences for e.g. readarray over parameter expansion, but the functionality is all there. I suppose it doesn't (and probably never will) fully conform to POSIX, if that's important to you

Re: Use zsh as the default shell on your Mac

#69

Earlier quoted context omitted.

Did you notice how many qualifiers you had there? The trend on macOS is clear: harder and harder to run/do anything that isn't blessed by Apple.

SIP and Gatekeeper and one-time commands. I find disabling SIP to be much less painful than enabling unsigned drivers in Windows. I wouldn't even classify turning off SIP as "slightly tricky". You boot into recovery mode, open the terminal, type in two words, and press enter. Besides, this is separate from the GPLv3 question. You can absolutely recompile bash and replace macOS's version with your own, so I don't unde…

The "You must release changes"-clause and anti-tivoization clause might be not be enough individually to switch to MIT zsh but probably were together good enough reasons for Apple to switch.

Re: Use zsh as the default shell on your Mac

#70

Earlier quoted context omitted.

SIP and Gatekeeper and one-time commands. I find disabling SIP to be much less painful than enabling unsigned drivers in Windows. I wouldn't even classify turning off SIP as "slightly tricky". You boot into recovery mode, open the terminal, type in two words, and press enter. Besides, this is separate from the GPLv3 question. You can absolutely recompile bash and replace macOS's version with your own, so I don't unde…

The "You must release changes"-clause and anti-tivoization clause might be not be enough individually to switch to MIT zsh but probably were together good enough reasons for Apple to switch.

Why? How does this affect them on macOS at all?

If Bash were also being used on iOS that would be different, but I'm quite confident that will never happen.

Post reply on HN