Live data from Hacker News

How zsh is more useful than bash

slideshare.net

31–40 of 151 posts

Re: How zsh is more useful than bash

#34

I love using zsh (in combination with oh-my-zsh) on OSX but the only thing I've noticed after using it a year is that it's becoming very very slow. As in, it usually takes me 5-10 seconds to login to a new session (locally) and be able to see the prompt and type something. Tab auto completion takes a second or two (even for files). Combined with the git plugin I have enabled (which does "git status" on every prompt i…

just use antigen instead of omz - it can use any plugin from omz but seems to be a bit more lightweight

Re: How zsh is more useful than bash

#35
I think the zsh-vs-bash debate is centered on minimalist vs. full-featured. For instance, the git completion example is very ugly in zsh to me. I know what git commands do, and I'd much prefer for the completion to take 1-2 lines total than one line per possible command, as in the zsh example. The prompt examples are similar -- my PS1 is

  local green="$(tput setaf 2)"
  local reset="$(tput sgr0)"
  export PS1="\[$green\]>>\[$reset\] "
And a multiline prompt, let alone one with right-justified elements, is pretty gruesome to me.

The first slides about availability on Macintoshes don't resonate, because I'm going to have MacPorts on any dev box and use that to install the latest. It's more likely I ssh to a server that has Bash 4 and no Zsh than anything else, so it also makes sense to know bash and have a good .bashrc ready to scp up there if I'm going to be doing a lot of work on the server.

zsh spellcheck is very annoying, thankfully it can be disabled. This is my preferred spellcheck solution ;^) https://github.com/mtoyoda/sl

All that being said, zsh is a really cool piece of software. It's one of those things I've always wanted to really stretch to its limits, but I've never been able to hang with it for more than a few months, which I doubt is enough time to really become accustomed to the workflows zsh allows (like the /u/b/... expansion example in the slides).

Re: How zsh is more useful than bash

#36
post #25
post #4

Problem is zsh is not omnipresent like bash is. I'm sure that if you use zsh you also use Plan 9, code in D, write LuaTeX in Emacs and wear a monocle.

These days, I use Zsh on OpenBSD. I don't use Plan 9, code in D or write LuaTeX, but I do use Emacs and wear a monocle. The last two are not a coincidence as the first (arguably more adequate substitute for God), invariably leads to the latter, most excellent eye wear. And a note to my Mac friends : "Using csh is like trying to type with your feets[sic] (if you're used to zsh or ksh)." http://forums.bsdnexus.com/view…

Bash has been the default shell since OS X 10.3 in 2003.

Re: How zsh is more useful than bash

#37

I see your zsh and I raise you fish: http://ridiculousfish.com/shell/ Try it. It's better.

> It's better. What's "better" about it?

1) A pretty great experience even before you start customizing. I only add a git status section to my status line and set some environment variables in my config.fish file.

2) An effort to clean up and orthogonalize shell syntax. The potential portability means I usually still make bash scripts when I'm sharing for others, but for my own stuff it's great.

3) Suggested completions. I start typing a command and if it's one I've used before in that directory it appears in faint gray letters on my command line and I just have to press ctrl-f to bring it up that way.

4) Probably a consequence of (1), but it feels very fast to me compared to when I used zsh. The author also talks about using threads and minimizing disk access to speed it up, but I don't really know how it compares to zsh on that level.

Re: How zsh is more useful than bash

#38

I see your zsh and I raise you fish: http://ridiculousfish.com/shell/ Try it. It's better.

I do love the tagline "_Finally, a command line shell for the 90s_".

I was happy enough sticking to bash as it's the default shell everywhere, but since someone switched me to Zsh (using oh-my-zsh) I probably rely on the features too much to ever go back. I also hear https://github.com/sorin-ionescu/prezto is a nicer, cleaner fork of oh-my-zsh but I haven't so found the overwhelming desire to go through the switching pains.

Re: How zsh is more useful than bash

#39

I see your zsh and I raise you fish: http://ridiculousfish.com/shell/ Try it. It's better.

I use fish. It's pretty fun to use. It has some pain points (most notably missing things like subshells and inline variable exporting) but it's in beta, so we'll see where it goes. I love the completions though, and it's definitely worth checking out for those alone.

Re: How zsh is more useful than bash

#40
One thing I don't see mentioned nearly enough is, if you're using extended globs, it's possible to tab-complete virtually all of it, which doubles as a handy reference.

For example:

    setopt extglob
    cd *(
    ~~ massive spam of possible glob qualifiers ~~
and it works for variable expansion modifiers as well:

    print ${(
    ~~ completion candidates for parameter flags ~~
    print ${
    ~~ complete any currently set variable in the current env~~
Another thing I like is the array types for things like $PATH that are historically colon-separated, typically lower-case versions of the var name for the interesting 'magic' ones.

    vared path
vs

    vared PATH
to see the difference.

    print -l $path # much easier to read
Post reply on HN