My Beautiful Prompt | Using Prezto & ZSH

From xkcd

I first learned to take baby steps on the command line about two years ago as I had to diagnose problems with remote installations of the IIoT application my team was building. But it wasn’t until a few months back when I switched to Ubuntu as my primary operating system that I truly appreaciated the power and awesomeness that a command line puts at the tips of your fingers.

Since then, I’ve tried my best to use the keyboard whenever my fingers were twitching to reach the mouse/touchpad. As a product manager who strides the worlds of business, design and code, I was astounded how many programmers are just OK with the default prompts that they are presented with. These are functional no-doubt but ugly. Very Ugly.

Of course, I started out with the defaults but as I developed my own preferences on tools (started out with bash then zsh and finally migrated to oh-my-zsh), I experimented with various terminal themes and custom prompts.

I hadn’t found quite the fit until I switched from using oh-my-zsh (it was becoming more of a burden) to Prezto.

Mike Buss got me started with the giddy user contributed prompt.

From mikebuss.com. All Rights belong to Mike :D

Two things I loved about this prompt: - The clean seperation between user@computer and directory path - The seperation of information on one line and commands on the other

I started of with the giddy prompt as my basis. A few modifications got me a prompt that I am finally satisfied with.

My beautiful prompt :D

Design Changes

I’m using the Base 16 Eighties Dark Theme for Gnome. You can find the files for other terminals at Chris Kempson’s excellent repo.

I didn’t quite like how the cyan in the theme was coming out for me. Went to the pallete editor from the top menu of the Gnome Terminal (Preferences > Base 16 Eighties Dark Profile > Color) and changed the pallete entry 7 to #C5EFF7

I also modified the colors, font strengths and arrangement of username and directory filepath.

Functional Changes

Added support for active Python virual environments

You can download and use it as your prompt.

  1. Download the file from my Github dotfiles repo
  2. Paste into your .zprezto/modules/prompt/functions path.
  3. Modify your .zpreztorc as shown below.
$ zstyle ':prezto:module:prompt' theme 'nphadke'
  1. Run source .zshrc

I’ll keep tinkering with this prompt but it seems good to go for now. This was the first post of a series that I’m planning on the tools and workflows that I’m favoring at the moment.