DEV Community

Why I am not switching to ZSH

Jonathan Apodaca on July 11, 2019

Recently Apple made a surprising announcement: due to licensing issues with Bash, they decided to change the default shell on macOS from Bash to ZS...
Collapse
 
thomasjunkos profile image
Thomas Junkツ

Fish is a nice and decent shell.
But if I made the switch I had to unlearn && and have to give up niceties like !-3.
At that point, I was done with fish. It's not fish's fault, but I am too lazy 😎

Collapse
 
flrnd profile image
Florian Rand • Edited

Fish history recall is very simple yet effective:

As in any modern shell, the Up arrow, ↑ recalls whole lines, starting from the last line executed. A single press replaces "!!", later presses replace "!-3" and the like.
If the line you want is far back in the history, type any part of the line and then press Up one or more times. This will constrain the recall to lines that include this text, and you will get to the line you want much faster. This replaces "!vi", "!?bar.c" and the like.

Fish docs

Collapse
 
thomasjunkos profile image
Thomas Junkツ

Thank you for your kind advice and hint to the docs.

Thread Thread
 
flrnd profile image
Florian Rand

No problem! I should thank you because I didn't know about !-3 before reading your comment. I was just sharing my findings :D

Collapse
 
jrop profile image
Jonathan Apodaca

The equivalent of && is ; and. However, for !-3, I never use that anyway, so I'm not sure what the equivalent is :D

Collapse
 
mt3o profile image
mt3o

; breaks if the call on the left ends with error?

Thread Thread
 
memphizzz profile image
MemphiZ

Then it's simply "; or" instead of "; and" in fish.

Collapse
 
jcmallozzi profile image
JC Mallozzi • Edited

Drink the Kool aid! Become one of us. Come over to the dark side. However you want to put it. Long time ZSH user here prob 10+ years. First thing I do on a system that doesn't have zsh, Install zsh, then pull my zshrc file from my server. One you switch, you will never go back. zsh's tab completion and case insensitivity for me makes it the ultimate shell out there, far more superior than bash will ever be. Altho I still write all my shell scrips in bash, I will forever be a zsh user.

Just my 2cents

Collapse
 
fadeddeath profile image
Eviscer8 🗝️ • Edited
  ___  ____            _           ____      _     _  
 |   |/   /           | |         /    \    (_)   | | 
 |   '   /  ___   ___ | |  ___   /   _  \    _  __| | 
 |      <  / _ \ / _ \| | |___| /   (_)  \  | |/ _` | 
 |   .   \| (_) | (_) | |      /   ____   \ | | (_) | 
 |___|\___\\___/ \___/|_|     /___/    \___\|_|\__,_| 
     _______________          ____________            
    ( _____________ ) ___    (            )           
    /    _     _    \/ _ \   (  OH YEAH!  )           
   /    (,)   (,)    \/ \ \ /_____________)           
  |         _         | | |               _______     
  |        (_)        | | |   _______    (  . .  )_   
  |     .       .     |/ /   (  . .  )_  |   o   |_)  
   \     '.....'     /__/    |   o   |_)  ) '-' (     
    \               /         ) '-' (    (_______)    
     )_____________(         (_______)                
____(_______________)_________________________________
Collapse
 
flrnd profile image
Florian Rand • Edited

If tab completion and case insensitivity are your strong points to defend zsh, don't ever dare to try fish shell.

Now in all seriousness, In my opinion, it doesn't matter which one, the important thing is to use whatever makes you comfortable in the command line. I like the 3 of them, all have strong points and weaknesses.

Collapse
 
jrop profile image
Jonathan Apodaca

Back when I tried ZSH, I was having trouble with completions: they would randomly stop working. I finally gave up spending the effort hunting the problem down each time. Perhaps it is better now, who knows!

Also, as mentioned above: I regard Bash as only offering slightly less than ZSH, and Bash usually comes by default on the systems I have to remote into. The cost of adopting ZSH is usually too high for me in my case.

Collapse
 
joshcheek profile image
Josh Cheek

I didn't learn bash well until I switched to fish. I think it's because I could finally do complex things in the shell, and then to share them, I had to figure out how to translate them back into bash.

Best fish feature, imo, is it's multiline support. I often compose scripts right in the shell.

I use programs over aliases, though (eg I would have a program gc) because these can be invoked from either shell, and even from non-shell processes.

Collapse
 
jrop profile image
Jonathan Apodaca

Fish is a much more sane scripting language than bash, or any POSIX shell, for that matter.

Collapse
 
intermundos profile image
intermundos

And I love orange pencils with slightly soft tip.

Seriously, you prefer using Bash over ZSH, we understand, but why devoting such a long post telling us about? What's next? Color theme of VSCode?

Collapse
 
bbarbour profile image
Brian Barbour • Edited

Because this is what he felt like writing about and it's his blog post?

😩

Collapse
 
intermundos profile image
intermundos

I respect his post in his blog, I just don't agree each of us start writing about his personal preferences in long posts, holding no useful information. You love bash? Great, use it, master it, share tips and tricks with us, not why you like it more than ZSH. I spent my time reading this post and at the end just understood my time was wasted on another "I prefer " writing.

Thread Thread
 
bbarbour profile image
Brian Barbour • Edited

Blog posts are a personal writing. That's literally the point of them. Some people use them for education, to deliver value in some way. Others talk about what interests them. All applicable uses of the platform.

You're just being grumpy and unreasonable.

Collapse
 
glennmen profile image
Glenn Carremans

I have only switched to zsh a couple of months ago and love it, because of zsh I actually spend more time in my terminal in stead of using GUI applications for everything.

I was wondering what OS has bash locked in?

Collapse
 
dhandspikerwade profile image
Devin Handspiker-Wade

Pretty sure "locked in" is referring to being unable to install. Example being a set of production servers. You can't just install ZSH on every server you connect to.

Collapse
 
jrop profile image
Jonathan Apodaca

Underrated comment, right here!