Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Autocompletion is one thing zsh does better, and that alone is worth it IMO. It can autocomplete things other than filenames and even gives you a short description for each of the subcommands or CLI options in the completion candidates. For the most common commands, this works without even having to install third party completion scripts. Bash, in comparison, has limited completion. Most of the time, it only completes filenames even after installing third party completion scripts. It's a major source of frustration when I find myself in a bash shell.

Syntax highlighting is useful as well, though that requires the use of a third party plugin. You can detect quoting errors, unmatched braces, missing commands, incorrect filepaths before hitting enter. It's indispensable in an interactive shell because that's where you write convoluted one-off one-liners.

ZLE, the zsh equivalent of readline, is also a major selling point. It allows you to create your own keybinding widget, a shell function bound to a key that can manipulate the current command line buffer. It's what enables the syntax highlighting plugin. With readline, you can only assign predefined functions.

In general, zsh is extensible and offers more capabilities than bash. But to feel the difference, you need to configure it and enable the nice features.



Autocompletion is another thing I don't like about it. The way bash does it is consistent with how other older shells did it. I can get over the weirdness but another annoyance there is having to hit the right arrow instead of tab or shift+tab.

It also didn't preserve bash's builtin functions which just means I have to learn its functions but when in a bind I just fire up bash and use it instead. The popularity of bash means scripts I write will almost always be for it as well, not gonna ask others to switch to zsh to run my scripts.

That said your points are very good. Like I said initially, I wish there was a script to fix all these annoyances, like a sibling comment mentioned how to fix the ! command recall.


zsh's autocompletion is highly configurable, so you can probably make it behave like bash. But I guess using bash would be better if you prefer its style of autocompletion. However, you should be able to use tab key for completion by default. If it doesn't work, maybe the following command can fix it:

    bindkey '^I' expand-or-complete


> Autocompletion is one thing zsh does better, and that alone is worth it IMO. It can autocomplete things other than filenames and even gives you a short description for each of the subcommands or CLI options in the completion candidates. For the most common commands, this works without even having to install third party completion scripts.

The joke here is: All this requires additional scripts / configs. Whether bundled or not…

With those scripts / config there is no difference between shells.

> Syntax highlighting is useful as well, though that requires the use of a third party plugin. You can detect quoting errors, unmatched braces, missing commands, incorrect filepaths before hitting enter. It's indispensable in an interactive shell because that's where you write convoluted one-off one-liners.

https://github.com/akinomyoga/ble.sh

> In general, zsh is extensible and offers more capabilities than bash.

Nobody ever could show me even one feature that isn't available in almost all popular shells!

> But to feel the difference, you need to configure it and enable the nice features.

Yeah sure. When you tune your ̵c̵a̵r̵ shell it has nice features afterwards…

That's true for any shell as I see it.

---

I for my part don't like Unix shell. Even after 20 years of usage (as since then Linux is my only OS).

Also I've never understood what's the case about zsh. Nobody could ever answer the question why it's anyhow "better" or even show features not available elsewhere.

I came to the conclusion that zsh is just a stupid hype of "cool kids". It's the same as with the car tuning crowd.

A truly better shell would be much different than a Unix shell. There are some experiments out there but nothing really convincing.

So I continue to stay with the not so cool default. As it's most compatible and available everywhere.

But please wake me up when there is some real innovation regarding shells!


> The joke here is: All this requires additional scripts / configs.

You mean a single line.

    autoload -Uz compinit; compinit
> With those scripts / config there is no difference between shells.

As I wrote in my original comment, bash only does filepath completion most of the time even with third party completion scripts. And I have never seen bash completion provide descriptions alongside subcommands or CLI options.

> https://github.com/akinomyoga/ble.sh

ble.sh is impressive work, but it's a hack that won't be as reliable or compatible without built-in support for programmatic manipulation of the command line buffer in bash. ble.sh works around bash limitations by diverting key input from readline and reimplementing its features. It contains workarounds for specific terminals, and scripts have to be modified to accommodate ble.sh. IIRC FZF's shell integration required modifications to work with ble.sh.

> Nobody ever could show me even one feature that isn't available in almost all popular shells!

Read the parts of my original comment which you haven't quoted.

> When you tune your ̵c̵a̵r̵ shell it has nice features afterwards…

Only to the extent that the shell lets you. Also, having features bundled in the default installation helps tremendously even if it's not enabled by default.

> I came to the conclusion that zsh is just a stupid hype of "cool kids". It's the same as with the car tuning crowd.

That was uncalled for. If you don't want to use zsh, that fine but don't assume things and throw insults at those who do.

> But please wake me up when there is some real innovation regarding shells!

The original comment was about how zsh compares to bash, not a critique of the unix shell.


You're right that all the shell additions are hacks (especially in Bash, as zsh was at least built with extensibility in mind).

But Unix shell is just a gigantic hack anyway…

It's a user interface build on top of a line printer terminal. In this regard all (true) Unix shells are the same, imho.

> As I wrote in my original comment, bash only does filepath completion most of the time even with third party completion scripts.

I don't see this. Almost all commands I use (besides very exotic ones) have competition.

Newer CLI tools come always with competition scripts for all popular shells.

> > Nobody ever could show me even one feature that isn't available in almost all popular shells!

> Read the parts of my original comment which you haven't quoted.

I've read your comment. It's sounds like the things I've heard hundred of times: "Here, look at this nice feature OOTB". In the end it turns out, more or less always, that there is also a config switch or external script for Bash that does the same.

> > I came to the conclusion that zsh is just a stupid hype of "cool kids". It's the same as with the car tuning crowd.

> […] If you don't want to use zsh, that fine but don't assume things and throw insults at those who do.

I did not insult anybody. I said it's a hype (which is imho a fact). And that's not an insult.

Naming people "cool kids" isn't an insult either.

Comparing "shell tuners" with "car tuners" is imho exactly on point. There are a lot of parallels.

"Car tuner" isn't an insult either. It's likely a funny hobby. (But I'm not into it.)

> The original comment was about how zsh compares to bash

Sure. And it was one of the usual "zsh has feature X" comment, where "feature X" isn't any zsh exclusive feature.

I'm quite tiered by such comments by now. It's just a part of the usual hype. When you start digging into it it always turns out that there's nothing special with zsh, and of course all other popular shells support it one way or another.

I've asked hundred of times that someone shows me something truly "magic" about zsh. But nop, there seems just to be nothing. But the imho groundless evangelizing continues…

That's why I call it by now "stupid hype".

And it's not like that I haven't given it a chance!

It took actually years to come to the conclusion that zsh is just a cool kid's hype. All the time before I thought that it's actually me overlooking something important. But no, there is just nothing.

Bash and zsh are exactly the same in my opinion. Just regular Unix shells. But people are fighting over some irrelevant minor differences. It's like arguing whether it's "better" to drive on the left or on the right side of the road. It just doesn't matter! More important is that you're "compatible"…




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: