Live data from Hacker News

How zsh is more useful than bash

slideshare.net

111–120 of 151 posts

Re: How zsh is more useful than bash

#111

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…

First of all stop using OMZ, it's a massive slow-down. Secondly use the git prompt that comes with git instead, there's no reason to use a custom one.

Re: How zsh is more useful than bash

#112
post #71

I switched back from zsh to bash, and I miss it terribly. Problem is, I need to run both virtualenv and rbenv, and they're both designed for bash, and don't work properly with my zsh for some reason.

I don't know about rbenv, but virtualenv works perfectly with zsh o.O

Re: How zsh is more useful than bash

#113
post #105
post #90

Earlier quoted context omitted.

local green="$(tput setaf 2)" local reset="$(tput sgr0)" export PS1="\[$green\]>>\[$reset\] " Could be this in zsh: export PS1="%{%F{green}%}>>%{%f%} " - %{%} replace \[\] - %F{color} sets the foreground colour - %f resets the foreground colour I would go with something like: export PS1="%{%(?.%F{green}.%F{red})%}>>%{%f%} " It will be green if the last command exiting successfully, otherwise it will be red. There's a…

Actually, except the `SHARE_HISTORY` option (which can be emulated), everything else is available in Bash.

Sorry, I just copy-pasted the whole thing. I know that most of the other options are available, though I didn't know that the HIST_IGNORE_SPACE was available in bash.

Re: How zsh is more useful than bash

#114
post #56

Earlier quoted context omitted.

Yes. Not only that but it has something even cooler: ESC + Q Let's say you are about to finish a really long command and realize you should have done one other command first. ESC + Q clears the current line, lets you enter a command, and then inserts the cleared line again on the next prompt. You have to try it to realize how cool it is.

> Yes. Not only that but it has something even cooler: ESC + Q ESC+. does not work for me with zsh. zsh 4.3.11 (i386-apple-darwin12.0) Maybe it's the version. ESC+Q also doesn't clear the line. At the same time, the OP links slide deck fails for me at the cd /u/lo/b part. It simply doesn't work.

You probably didn't turn it on when you ran the config wizard thingy.

Re: How zsh is more useful than bash

#115
post #61

My personal favorite zsh specific feature is the REPORTTIME environment variable. When set to a nonzero number it'll automatically print a summary after a long running command. My own http://imgur.com/6LCS1cj

Hmm doesn't work for me, is it an option you need to turn on?

Re: How zsh is more useful than bash

#117
I really enjoy the regex completion.

Example: $ rm * .gch dir/* .gch

$ rm file1.gch file2.gch file3.gch file4.gch dir/file5.gch

I really enjoy it when I'm removing something sensitive and just want to make sure.

Re: How zsh is more useful than bash

#118
post #115
post #61

My personal favorite zsh specific feature is the REPORTTIME environment variable. When set to a nonzero number it'll automatically print a summary after a long running command. My own http://imgur.com/6LCS1cj

Hmm doesn't work for me, is it an option you need to turn on?

It's a normal variable, not one set by `setopt`. The following should make commands that take longer than 1 second be reported:

    export REPORTTIME=1

Re: How zsh is more useful than bash

#119
post #66

While zsh may be more 'useful', I find it a bit too smart. Many of the features are very interactive, and introduce a non-determinism that messes up my ability to fix errors. An example is command correction. I (usually) know when a command is wrong, and go to fix it without thinking. Being asked if you really meant some other command interferes with this, and while seemingly helpful, makes you wonder if a shell shou…

I don't use them. But there are similar stupid features in bash which I also don't use. Configuring a shell seems normal to me.

I prefer not to configure much, the more I configure on my system, the harder it's to use another system (although, just using vim makes this hard on non-vim text editors.) Although I do find bash-completion handy in many situations (mainly for sub-commands), for mplayer it refuses to tab-complete videos not ending in a proper extension, which is rather annoying.

Don't get me wrong though, bash does have its bad points.

Re: How zsh is more useful than bash

#120
post #31

yes, bash is great except it's not default sh.

lolwut

Bash is the gnu shell which is a superset not posix which is basic no frills mixture of minimal ksh and bourne syntax.

BSD has the almquist shell as it's /bin/sh and tcsh as it's /bin/csh. Various commercial vendors licensed the korn shell from bell labs. The korn shell is public domain and open for 13 years now. The default sh on most UNIX boxes are either ash or a hard link to ksh which emulates the POSIX definition of sh. zsh and bash also provide the option to hard or soft link so depending on your distro you may have /bin/sh linked to bash.

Debian at one point repackaged the BSD almquist shell as their system sh calling it dash mainly for speed and stability. I believe they removed it as their programmers apparently couldn't program system level scripts without their non portable bashisms or maybe just one of the NIH moments where everything must live under a single mono-cultural license and identity.

Post reply on HN