Pimp my Terminal – macOS Terminal, iTerm2 & Alacritty
Making Terminal Emulation Prettier
With MacOS X came the Terminal, a tool to access the Command Line. Previously using Bash Shell, but since macOS Catalina, it’s been ZSH.
I assume you’ve already worked with the command line on Unix, Linux, or Mac.
So, you are probably familiar with the essential commands like cd
, ls
, and so on. Perhaps you’ve also used the vi
or vim
editors.
With my new blog series, I want to help you get even more out of the terminal, the command line, and tools like ZSH, VIM, NEOVIM, etc.
Today, I’ll start with the terminal application itself. In future posts, I’ll cover tools like ZSH, OH-MY-ZSH, ANTIGEN, TMUX, VIM, NEOVIM, and so on.
Which Terminal Emulations to Use?
Generally, three terminal applications are popular on Mac:
- Terminal
- iTerm
- Alacritty
Each has its pros and cons. You’ll also learn how to enhance them visually and make them more productive.
There are other disadvantages for Mac users. If you know a good alternative, feel free to comment below.
Terminal
The Terminal is pre-installed on every macOS, so you should already be familiar with it. It suffices for many tasks, virtually everything. I usually launch it 99% of the time through the Spotlight search Command + Space
and then type the first letters of Terminal
. Otherwise, you can find it in the Utilities folder.
Actually, there’s not much to complain about Apple’s Terminal.
It’s said to be slow. For many, this won’t matter. But if you’re doing something in the Terminal with a lot of changes, it can slow down the process slightly.
Besides performance, there are two more reasons to switch. One is that the Terminal only supports 256 colors. This isn’t a problem per se. However, more and more modern applications like neovim rely on True Color as standard.
Then there’s the reason that the Terminal isn’t as cool as the other two options, thus lacking 5000 important nerd functions. 😉
Pimp My Terminal with the macOS Terminal
Of course, you can also spruce up the Terminal visually.
For this, only two things are necessary. Firstly, you need a suitable font that’s visually appealing and offers more options (more on this in later posts).
Enter the following command in the Terminal to install the font. You’ll need Homebrew for this. You can learn how it works in my post about Homebrew.
brew install homebrew/cask-fonts/font-sauce-code-pro-nerd-font
Next, I’ve created a ready-made profile for macOS Terminal for you. You need to download and import it into Terminal. Go to Settings
under Profiles
and click on Import...
.
Visually, it’s already better. The profile uses the Gruvbox color scheme. It’s very popular and, I believe, originally created for VIM.
iTerm2
If the Terminal isn’t enough for you, take a closer look at iTerm2. It’s an open-source project developed specifically for macOS as a replacement for Terminal.
It’s much faster than Terminal, has incredibly many features, supports True Color, and much more.
Some of its additional features include:
- Split Panes
- Hotkeys
- Search
- Shell Integration
- and many more
Installation is very easy thanks to Homebrew.
brew install --cask iterm2
If you haven’t already installed the font from above, do it now with brew install font-sauce-code-pro-nerd-font
. You will need it for the following iTerm2 visual profile.
Why This Font?
It is based on Source Code Pro, but modified with Nerd Fonts. Many themes and tools, like Powerline or Powerlevel10k, use icons and symbols contained in this font.
The Profile for iTerm2
I’ve also prepared a ready-to-download iTerm2 profile for you. It’s visually identical to the Terminal profile mentioned above.
The installation is comparably easy, just like with Terminal. In iTerm2, simply press Command + ,
. There, under Profiles
, click on Other Actions...
. With Import JSON Profiles...
, you can import the profile. Visually, it’s almost identical to the above-mentioned Terminal profile, including gruvbox theme, font, window size, etc.
Alacritty
Finally, I want to introduce you to Alacritty. It’s the terminal I personally use.
Why Do I Use Alacritty?
It has, initially, fewer features than iTerm2. However, it has all the features I need.
Just the startup of Alacritty is noticeably faster than Terminal or iTerm2. It’s also a bit faster in display than iTerm2.
Unlike the other two terminal emulators, it is cross-platform. This, combined with the fact that it has no graphical settings and everything is done in config files, is an advantage. Of course, this is only a benefit if you use multiple platforms. This could be useful, for example, if you use an iMac and a MacBook and want to keep the config synchronized between the two.
Is it Perfect?
Unfortunately, Alacritty isn’t perfect. The configuration is a bit more challenging than just a few clicks. Under macOS, some mandatory parameters must be correct; otherwise, for instance, some keys may not function as they should.
In the end, you now have the opportunity to test all three and choose the one that suits you best.
Installation of Alacritty
Again, simply via brew:
brew install --cask alacritty
You also need to have the above font installed, as I use it in my config.
If the directory for the config does not exist yet, you need to create it.
mkdir -p ~/.config/alacritty
Now download the finished Config for Alacritty and save it there.
If you want to do this via the GUI:
open ~/.config/alacritty
Visually, the result is again almost identical to the two terminals mentioned above. So, it also uses gruvbox colors. The keyboard (German Keybindings) is pre-set for a MacBook with Touch Bar. In the text file, you will also find other variants. This concerns characters like |
.
What Comes Next?
Next, I’ll be posting a blog about how you can make better use of your ZSH (which is the standard shell from macOS Catalina onwards). Here, I’ll introduce a package manager for ZSH and a few useful extensions that make work easier. After that, we’ll look at vi, vim, and neovim. This will be a whole series of articles by itself.
If you’ve made it this far, I’d love to hear your comments. 🙂
wie kann man die systeminfomation so cool anzeigen lassen? system_profiler SPSoftwareDataType SPHardwareDataType
Hi. Das Tool nennt sich neofetch.