Contents

How To Customize Your Windows / Mac / Linux terminal

Customize your Windows / Mac / Linux terminal with Oh-My-Zsh

Background Story

Yesterday I got the question about customizing macOS/Linux terminal more beautiful and not boring. I am using OS X Mojave 10.4.6 for my daily driver to do daily tasks. There are four component in this article, terminal application, shell type (like bash, zsh, fish, etc), fonts that support icon and emoji, and shell theme.

Terminal Application

https://miro.medium.com/max/770/1*zs-WZ36GjGomzYnWnAwPjw.png
iTerm2 Logo

In my OS X, I used iterm2 for my terminal application. I used this terminal application because it provides so many color schemes. The color that I used for my daily is Lovelace. It’s very good, soft, and not hurt the eyes. In Linux terminal you will have a lot of kind terminal application like Konsole/Tilix/Gnome Terminal, and so on. Linux is more customizable than OS X, so don’t worry about the color scheme you will get more color scheme too.

https://miro.medium.com/max/727/1*FXH-aNqRlUGTudiehRdyUA.png
iTerm2 Color Scheme

Shell Type

The terminal application is just an application. It would not change your shell prompt nor suggest entries from your command history. For that reason, I use zsh with the oh-my-zsh framework to manage my zsh configuration. If you use OS X Catalina you should not worry about it, because the default shell of OS X Catalina is zsh, but you must install zsh oh-my-zsh. For Mojave user use Homebrew to install zsh, with the command below:

1
$ brew install zsh

If you are a Linux user, please install it with a specific package manager like apt, dnf, or pacman. For example: Debian/Ubuntu:

1
$ sudo apt-get install zsh

Fedora distro:

1
$ sudo dnf install zsh

Arch Linux based distro:

1
$ sudo pacman -S zsh

After you get the zsh working, you will need to install oh-my-zsh with one of the commands below:

1
2
3
$ sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# OR
$ sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

After the installation you will get your terminal something like that:

https://res.cloudinary.com/practicaldev/image/fetch/s--0ZVbgHEZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/http://res.cloudinary.com/lauragift/image/upload/v1524834046/Screenshot_from_2018-04-27_13-58-51_ffofu9.png
Oh My Zsh Screenshot

Font and Shell Theme

Oh-my-zsh is the framework for manage our zsh configuration, but it has a default theme. It’s great for some people but not for me. It’s very standard basic and not really beautiful in my opinion. So in this article, I choose to use powerlevel10k. In those link, it recommends using MesloLGS font. The font is pretty good at least it support icon and emoji. Let’s use it in this article. To install powerlevel10k just use the command below:

1
$ git clone --depth=1 https://github.com/romkatv/powerlevel10k.git $ZSH_CUSTOM/themes/powerlevel10k

After that change your zsh configuration file to match with powerlevel10k with the command below:

1
$ sed -i -e "s~robbyrussell~powerlevel10k/powerlevel10k~g" ~/.zshrc

Close your terminal, and open it again. You will get installation powerlevel10k, and choose your own preference. After that my terminal look like this

https://miro.medium.com/max/770/1*d-iqesV-msIbzACaVhjpZQ.png
iterm2-terminal screenshot

That’s it! Thank you for reading my article