I have been using bash for a few years, and I found it hard to migrate to other shells because I have already created a small collection of helper functions and scripts for my everyday use.

For zsh, I had quite some analysis paralysis for it: it is not quite functional right after installation, but the commonly installed oh-my-zsh comes with about one hundred themes, and the configuration starts to get overwhelming. And to make things worse, this is not completely about aesthetics: each theme offers different functionality and look and feel.

Goals

Hence, again, I need to define my goals before making the choice. Since a shell is something I use everyday, a gradual change in use experience would probably help preserve my productivity.

Git integration

I have been relying on my bash prompt that shows the current git branch. It was one of the few features that’s almost universally useful for me, because git is almost universally useful.

Return value

Another feature I had been using in my bash theme is to show the return value of the last command. Occasionally, complex bash scripts and makefiles either print not enough information or too much for me to determine whether the last operation was successful. A quick look at the return value accelerates things.

Use common glyphs

Part of the result of messing with distros like Gentoo Linux in both desktop and notebooks, and, in more distant memories, Linux kernel plugins, is that sometimes I have to live in the tty’s. They are not my favorite working environment, but sometimes they are inevitable during the installation of a new system, or after I broke something.

Hence, I would prefer if my theme can work well with a font that only supports Code Page 437 characters.

No information to the right

Some themes display information such as Git status at the rightmost of each line. I am curious about the effect of this decision, and give the idea a try.

My conclusion? It is terrible for me.

The problem is that such a design does not scale well with the physical window size. It works well if you use an extremely small screen, or if you always divide your screen into multiple terminals, either via a tiling window manager, or a virtual terminal simulator such as tmux.

For me, however, it is not always the case. Sometimes I divide my screen into small windows. Sometimes I don’t. It depends on my current task. And I value this flexibility.

Interesting as it is, the decision to put status line to the rightmost of a window would hurt the kind of flexibility I wanted.

Re-creating my current Bash experience

My current Bash prompt is actually pretty vanilla. It looks like this:

It features a git branch prompt, and the symbol also indicates that I am within a git repository, and its green color indicates that the last command was successful.

By utilizing similar functionalities available in various example zsh themes, I could replicate the effects easily:

The color is different because my original bash script uses different colors in 256 color mode and 16 color mode. My zsh theme has not handled that yet.

An integral theme

Skimming through the many zsh themes makes me want to also try a two-line theme again. And what’s a less explored idea for a two-line theme, within the limitation of Code Page 437?

The answer is… the integral symbol ( and ). They were designed to be used to form a big two-line symbol from the very beginning of their existence.

For everything else, I currently use minimalist designs. Gamma (Γ) as the git branch prompt and  house () are also among the natural choices available in the 437 code page.

Conclusion

So here begins my two initial zsh themes. They are available on Github.

Obviously, I will gradually improve them over time and add new features, but I hope they become good enough starting points.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.