Unleash your inner root

Zsh: the good, the bad…the WTF

As I mentioned in a previous post. I have been wrestling with the idea of ZSH as a replacement the ever glorious BASH. Early results have been promising. ZSH does indeed offer mounds of power and customization, but BOY HOWDY is it NOT an easy thing to get into.

With BASH I never felt like I wasn’t making the most out of it by not customizing it to my needs. I always felt like it was doing what it was supposed to be doing: Being a shell. With ZSH I feel like I’m building up some rice rocket super car that if I don’t tweak every little thing that can be tweaked I’m missing the point.

I had resolved to NOT use oh-my-zsh, despite many people saying it was the best way to get into zsh. “Why would you shoot yourself in the foot like that?” Those among you using it already might say. “Good question!” I might reply. Here is the deal: I like the idea of a pre-packaged super set of settings/plugins that makes things easy for me to get started, however I’m VERY against the idea of A) needless bloat with packages I don’t use, and 2) Settings that I don’t understand. This however is irrelevant to my original point: zsh is a slippery slope.

Very quickly I realized that without using ohmyzsh or some alternative, I would never be able to FULLY make use of the power people on the interwebz were ranting and raving about. Enter antigen.

Antigen is a package manager for zsh that allows some granular control, you can pick and ch…oh, sorry have I lost you already? Yes, you heard me correctly: I have a package manager…For…My shell… I know, I had a hard time dealing with it too, Like I said: Slippery slope. The idea of a package manager for a shell is absolutely ridiculous, and yet…Here we are. Anyway, With Antigen you can pick and choose plugins and themes and what not from various repositories, and it is flexible enough to be able to handle repositories that it doesn’t yet know about(as long as you know the url it can handle it). So it gives me the power I wanted out of zsh, without the all encompassing nature of oh-my-zsh…Better yet, I can even still pull packages from oh-my-zsh if I want them, without committing to the whole kit-and-caboodle(whatever that means).

My journey into zsh is a slow one, I’m sure If I would just give in to the darkside and use someone else’s pre-made .zshrc I would be bounding away on plains of infinite joy, but I want to understand what makes my shell tick, rather than just having a shell that ticks like a clock for no discernible reason.

Configuration frustrations aside, Whats my experience been like? Well, overall its been good! It has some nice features. It has some nice conveniences. It is not perfect however.

Just this morning I attempted to run updates on my CentOS test box. I found that my /boot partition was a bit full, so it couldn’t download the latest kernel. Feeling lazy, I decided I’d just skip the kernel update for now and clean up old kernels later, so I issue the ever simple:

yum -y update --exclude=kernel*

A command I have used many many times, either A) because of Laziness, or 2) Being on a change controlled system that is not currently approved for a new kernel to be installed… So imagine my surprise when instead of recieving all my updates minus kernels, I got this message:

zsh: no matches found: --exclude=kernel*

Having recently moved from a RHEL/CentOs 6 environment to testing version 7, I assumed that for some reason the latest version of CentOS removed the –exclude option from yum for some unknowable reason, thankfully thats not the case. What else is new in my environment: zsh… I switched to bash and the command worked fine…Curious.

After some research I found it may be a globing probolem

So I enacted a similar solution:

alias yum='noglob yum_wrap'
function yum_wrap {
  local -a args
    local i
      for i in "$@"; do case $i in
          (*:*) args+=($i) ;;
              (*) args+=(${~i}) ;;
                esac; done
                  command yum "${(@)args}"
                  }

Still no dice.

I can confirm it is definitely something to do with globing but I cannot find the exact reason. In addition: Whenever I type a command that doesn’t exist I get TWO “Command not founds”:

zsh: notarealcommand: command not found...
zsh: command not found: notarealcommand

As petty as this sounds, its things like this that INFURIATE me. I can handle huge issues that need to be worked through, but I have zero tolerance for basic every day quirks that you have to live with because they have no real answer. Little everyday reminders that stare you in the face and tell you “I’M BROKEN AND THERE IS NOTHING YOU CAN DO TO FIX IT!” Those things are deal breakers for me.

I have not yet given up hope on zsh, but if these things keep adding up, I may have to throw zsh through the window and go back to the simple functionality of bash. “Whoa, Going back to bash because of two little annoyances? Doesn’t bash have way more of those that zsh actually fix’s?” Yes, yes it does, but those are the issues i’m USED to, to me they aren’t quirks they are limitations in design. Zsh adds convenience to a TON, but if it in the process breaks things that bash, the slow and simple shell it likes to make fun of, already does right, then I have NO patience for it.

Also “grumble grumble grumble”

rantszsh

Brandon.Graves • February 8, 2016


Previous Post

Next Post

Leave a Reply

Your email address will not be published / Required fields are marked *

%d bloggers like this: