How to get an amazing Terminal. In Windows and Linux; including... | by Martin Thoma | Towards Data Science

As a developer with 10+ years of experience, I love using the shell. The commands never change, I can create custom shortcuts, it’s reliable and fast. The defaults are not great, though. After reading this article, you will know how to get an awesome shell + terminal on your system.
The shell is what actually executes the command. The terminal is a wrapper that runs the shell.
The terminal is where you set the font face, font size, color schemes, support for multiple tabs. Examples for terminal emulators are GNOME terminal, Konsole on KDE, Terminator, and XTerm. On Linux, I recommend keeping the default. On Windows, the Windows Terminal is awesome. On Mac, I’ve heard good things about iTerm 2.
The shell stores the history of entered commands, defines how you set environment variables, how you switch the current directory. Examples for shells on Linux are ZSH, Bash, fish. On Windows, the typical shells are PowerShell. You can see which shell you are running by executing echo $0 . On Linux, it’s most likely Bash.
Every shell has a prompt. The prompt is what is written before your cursor. It signalizes that you can enter a command and gives useful context information. In the example above, the prompt contains the user name moose , the current computer pc08 , the current working directory ~/GitHub/MartinThoma/flake8-simplify , the active git branch feature/19 and the fact that there are modifications ±.
No matter what you take, the font matters. You might want to have a monospace font. And you for sure want a powerline font; trust me with that one. The powerline font gives your shell the possibility to use characters that look like images. It can make the prompt way nicer.
I like Ubuntu Mono and Droid Sans Mono:
There are also “programming fonts” like Fira Code or Jetbrains Mono. I don’t like them, because they make it harder for me to really know what is written. They look nice, though.
First, make sure you have the Windows Terminal installed:
www.microsoft.com
Launch a terminal and navigate to the settings. It’s this small downwards pointing “arrow”:
You should see a JSON file which you can change to fit your taste. I have the following:
Download and install all 4 “DejaVu Sans Mono Powerline” fonts. On all systems I know, installing a font is done by double-clicking it. Then a window opens which has an “Install” button.
Aminal is a Terminal Emulator written in Go. It can be used on Linux, Windows, and Mac. It allows configuration via a configuration file and includes the color and keyboard shortcuts in it.
First, you need to install and configure Go on your system. On Ubuntu, it works like this:
$ sudo apt-get install golang libgl1-mesa-dev xorg-dev$ export GOPATH="$HOME/go"$ export GOBIN=$(go env GOPATH)/bin
Then you can install and run aminal:
$ go get -u github.com/liamg/aminal$ aminal
The Gnome terminal can be customized by editing the profile. Here I set the Ubuntu Mono derivate Powerline Regular with a font size of 12.
The command is set to zsh as this is my favorite shell.
The colors are set to solarized dark (left-to-right, top-line / bottom-line)
Background: #2e3436 / #555753
Dark Red: #cc0000 / Light Red: ef2929
Dark Green: #4e9a06 / Light Green: #8ae234
Dark Yellow: #c4a000 / Light Yellow: #fce94f
Dark Blue: #3465a4 / Light Blue: #729fcf
Dark Purple: #75507b / Light Purple: #ad7fa8
Dark Teal: #06989a / Light Teal: #34e2e2
Dark Gray: #d3d7cf / Light Gray: #eeeeec
Install the fish shell:
sudo apt-get install fish
Change the default shell in your terminal emulator to fish . Within Gnome terminal, it is called “custom command”.
Then install “Oh My Fish”:
curl -L https://get.oh-my.fish | fish
And set the theme to agnoster:
omf install agnosteromf theme agnoster
For cool features of the fish shell, read Why I Use Fish Shell Over Bash and Zsh by Alec Brunelle.
A core part of making the terminal awesome is making common commands short. To do so, you create an alias for a command — a shorter version of the original command. The most common example is changing a directory to go one level up. For example, if you are in /home/user/foo/bar , you want to get to /home/user/foo . In most shells, you have to enter cd .. . I like to abbreviate that to .. . So I have the alias alias ..='cd ..' . The syntax may vary, depending on your shell. For Bash, ZSH, and fish it is
alias short='long'
For bash, you insert them in ~/.bashrc , for ZSH in ~/.zshrc . In fish, it is different.
Here are some aliases I like:
# Shorten thingsalias ..='cd ..'alias ...='cd ../../'alias ll='ls -alF'alias la='ls -A'alias l='ls -CF'alias c='clear'# If your terminal supports colors, use them!alias ls='ls --color=auto'alias grep='grep --color=auto'alias fgrep='fgrep --color=auto'alias egrep='egrep --color=auto'alias diff='colordiff'# Works only if you have notify-sendalias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
Make sure you have a reasonable terminal emulator. I suggest Gnome Terminal for Linux, iTerm 2 for Mac, and Windows Terminal for Windows.
Install a good powerline font like Ubuntu Mono Powerline.
Adjust the font face, font size, and color scheme of your terminal emulator to your preferences.
Install a good shell. I suggest fish for Linux and PowerShell for Windows.
Adjust the prompt of your shell to your needs. I like the agnoster theme.