Amazon.co.uk Widgets

Log in

X
zsh logo

Terminal prompt with architecture

Terminal on macOS and Ubuntu Desktop is a power tool and it can be made better. There are lots of shell customisation utilities around but the most useful to me at least in software development and devops, is zsh-powerline which is an implementation of powerline shell which was inspired by the powerline statusline plugin for vim.

For me, modifications must not hurt performance, and should not be distracting. Prompt based elements must be things I really need to know about the current environment right now.

The text colours are a reminder of my favourite real terminal :)

zsh prompt in Ubuntu

When you ssh to an different computer with the same zsh environment the prompt displays the username, computername, cpu architecture, git branch and OS symbol.

Git branch is only if you 'cd' into a repo. OS Symbol is green if the last command exited properly, red if not.

Thats what I need to know, and it isn't too distracting.

macOS

zsh prompt in macOSMy macOS terminal prompt shows username, computername, architecture, git branch, exit status of the last command, OS symbol and shell prompt.

On macOS the OS symbol is the Apple logo.

Ubuntu Desktop 22.04 LTS

zsh prompt in Ubuntu

My Ubuntu terminal prompt shows the username, computername, architecture, git branch, exit status of the last command, OS symbol and shell prompt.

On Ubuntu Desktop the OS Symbol is the Circle of Friends logo.

zsh-powerline with architecture

I forked zsh-powerline so that I could add my changes and keep them in github for easy redeployment on my Mac and Ubuntu Desktop computers. You can find my changes here in the multizone branch. https://github.com/multizone-uk/zsh-powerline/tree/multizone

Essentially I just added a colour for the architecture prompt, and then added the CPU architecture to the prompt configuration. Lastly I adjusted the prompt configuration to how I like it. Details are in the README.md. 

Terminal settings (macOS)

I hardly ever touch the terminal settings on macOS or Ubuntu Desktop but while I was doing this I made them a little better for me. Here they are in case they are useful. I like 132x50 as it reminds me of listing paper which was 132 columns wide. I need bigger fonts these days for my eyes. I like the amber text which reminds me of my first Unix® terminal at Sun Microsystems back in the 80's.

Terminal Settings 132x50

Terminal Settings amber screen

Text colours

Terminal preferences

Terminal settings (Ubuntu Desktop 22.04 LTS)

Terminal preferences in Ubuntu More Terminal preferences in Ubuntu