Live data from Hacker News

Use zsh as the default shell on your Mac

support.apple.com

111–120 of 252 posts

Re: Use zsh as the default shell on your Mac

#111

For those wondering why Apple is allergic to GPLv3 code: there is a clause in the license requiring you provide a way to run modified version of the software which would require Apple to let users self sign executables.

So, Homebrew? You can't tell me that Microsoft is able to ship entire distribution's userlands (Debian, Ubuntu, SUSE, and more) through the Windows Store, including all their GPL3 components, and Apple can't figure out how to ship an updated version of base64. If I'm grumbling, it's just because making devops/CI scripts work on Windows and Linux is easier than MacOS and Linux these days because my colleagues run into…

That is nothing compared to writing portable UNIX scripts during the UNIX wars.

Having to deal with three variants is relatively simple.

Now having to deal with DG/UX, Aix, Tru64, SGI, HP-UX, Solaris, BSD and the new incumbent Linux, that was fun.

Re: Use zsh as the default shell on your Mac

#112

Earlier quoted context omitted.

Not anymore. Since 10.12 Sierra the GUI option to turn off Gatekeeper is gone, you have to use command line to turn it off. And now App Notarization is making it harder still to run your own software.

How so? I can run anything I like via the command line, and right-click -> Open still launches unsigned executables. Sure there are warnings, but that's not hard to get past.

> I can run anything I like via the command line

The discussion is literally about replacing the default shell...

Re: Use zsh as the default shell on your Mac

#113

Earlier quoted context omitted.

Since when is mainstream better? Why did they choose zsh? They don't justify that either. It's just odd to pick one post-bash shell but not the other when they have very similar feature sets—autocomplete, persistent global variables, attention to end-user quality. EDIT: apparently zsh doesn't have persistent or global variables, my bad.

There's already a lot of community support available for zsh. Plenty of developers are using oh-my-zsh either for just the plugin support or for the very popular iterm+powerlevel9k+agnoster theming.

Pro tip: s/powerlevel9k/powerlevel10k/. Same config, same theme, but much faster.

Re: Use zsh as the default shell on your Mac

#114

From 2012 - Apple's great GPL purge: https://news.ycombinator.com/item?id=3559990 Short-sighted move considering Microsoft is actively looking to ship a Linux kernel in Windows.

Followed by Google's GPL purge.

The only GPL stuff left on recent Android is the Linux kernel, and well, Fuchsia is improving.

Re: Use zsh as the default shell on your Mac

#115
post #103

I've never worked outside bash. I have a lot of simple bash scripts. (Usually just stringing together commands with the occasional pipe or output to file) Will this break all those or are bash scripts and zsh scripts basically interchangeable?

As the other person said, if your scripts are executables with an sh or bash 'shebang' at the top, they will continue to use the same shell they always did. But if you did want to run them with zsh, most simple scripts that just set environment variables, string together commands, or redirect to files should work without any changes. The most obvious difference for basic scripts like that is that zsh doesn't split pa…

The minor modification would be from `$opts` to `$=opts`.

I'd been using ZSH for a year as if it was Bash with better history and much better completions. The difference mentioned above was the only one I knew about. I kept writing my scripts in Bash and was quite happy with the UX.

Re: Use zsh as the default shell on your Mac

#116
post #112

Earlier quoted context omitted.

How so? I can run anything I like via the command line, and right-click -> Open still launches unsigned executables. Sure there are warnings, but that's not hard to get past.

> I can run anything I like via the command line The discussion is literally about replacing the default shell...

I don't see how that's relevant to this subdiscussion, since the switch from bash to zsh won't effect what he's talking about.

Re: Use zsh as the default shell on your Mac

#117

Earlier quoted context omitted.

Sorry, how is that a problem? Users can build and execute code on their own Mac with XCode.

Perhaps Apple's vision for the future is one where you can't do that (ex: App Notarization seems to have us heading in that direction.)

Plus, removing the scripting runtimes in future versions of Mac OS. https://developer.apple.com/documentation/macos_release_note... https://news.ycombinator.com/item?id=20089811

Re: Use zsh as the default shell on your Mac

#120

I'm really surprised they went with zsh rather than fish. I guess they want to preserve the ability for existing `source` scripts to work.

As MacOS is a certified Unix, like the workstations of days gone by, they should've gone all out enterprise and switched to ksh.

Heck, the new Mac Pro is even priced like a SGI/AIdX box.

Post reply on HN