Friday 22 July 2011

When giving it a Bash just doesn't cut it

Or what's in a Shell?
Bash is pretty much the de facto standard shell everyone sees whenever they open up a terminal. I can't say for BSD, Solaris or Mac systems, but on every Linux based system I've ever used, and even on Cygwin/MinGW on Windows, the Bash shell is the default.

Bash has and still does serve many people well. It's extendible with the bash-completion options, adding lines to the right files it sources can be quite powerful. Even the prompt itself can be customised a great deal.
But there comes a time for nearly every app on any system where the user will inevitably ask that question: 'Is there anything better out there?'

Of course 'better' is a matter of perspective. Some say KDE is better than Gnome. Some say the spartan desktops provided by just a simple tiling window manager are better than a fully fledge desktop session.
But the only real way to tell if something is better in your own opinion is of course to try it yourself.

Now, the Bash shell is something that like many people I rarely actually think about. I think in terms of the terminal itself - right on the console with no X session, within Terminator or a Gnome Terminal, maybe even xterm when all else fails for whatever reason. But essentially all they are is a way to give you your selected Shell - Bash.
Over time though, and through periodic trawls through package listings when bored, I keep noticing other shells. ksh, dash and zsh to name but a few.

Zsh is the only alternative I've tried yet, and after a little experimenting with it, its quickly become the default shell for me. I find it's even more powerful than Bash, without losing any functionality at all. The completion in Zsh can be autoloaded and is much better than in Bash.
Small annoyances such as forgetting to type 'cd' when moving around directories are easily resolved with a simple command. Type a directory, and it can be told to act as if you'd prepended it with 'cd'.
Often find yourself mistakenly typing suod instead of sudo, or other such similar mistakes? There's a little command that'll make zsh prompt and ask if you want it to auto-correct it for you.

There are two caveats though.
Firstly, if zsh can't find and .zshrc in your home folder, it'll assume you've never run it and go through a sometimes bemusing first-run wizard. Which is useful in it's way, but you're better of creating the file yourself and running around the Internet looking at the great many guides and pages on it - or of course, read the man pages on it. I'm not going to list all the pages here, but two that you should definitely look at are the Arch Linux wiki page, and the Gentoo Wiki page (Note that the latter is not linked to from gentoo.org - go to en.gentoo-wiki.org instead)
And Secondly, it doesn't always act the same way as Bash. For example, Home and End do not move to the start or end of the line you're entering. I've yet to find a fix for this, but it's only a minor annoyance for now.

These are just my initial impressions of it. I've barely been using it for an hour, but it's impressed me, and I'm sticking with it for now. As for you, as said earlier - the only way you'll be able to tell if it's better for you is to try it yourself.

That's all from me. Keep on rocking, people.

No comments:

Post a Comment