NOTE: This tutorial will use iterm2 which is a popular alternative to the MacOS terminal. If you want you can use other terminals, usually Alacritty is a good option and looks damn cool too. Installing tmux-256color for macOS. MacOS 10.15.5; tmux 3.1b; macOS has ncurses version 5.7 which does not ship the terminfo description for tmux. There're two ways that can help you to solve this problem. The Fast Blazing Solution. Instead of tmux-256color, use screen-256color which comes with system.
Alacritty, the nihilist terminal setup
Alacritty is a suckless terminal emulator written in Rust, it’s extremely fast and very simple. Here’s how to install and configure it.
What is a suckless program?
Software with a focus on simplicity, clarity, and frugality.
Meaning, for example, that Alacritty will never 'call home' to gather telemetry, aka track you. It will never haze you with automated update notices. There’s no package manager, there’s no GUI for settings, nor for menus, it doesn’t have tabs, there’s nothing... just a void of pure, unadulterated nihilism.
This either sucks less, or sucks more, depending on your personality.
Install Alacritty on Mac OS
I’m on Mac, so this install guide is Mac-centric, but see the Alacritty repo for more installation instructions.
Since Alacritty is a GUI app (icon in the Applications directory), in Homebrew-land this means it’s a 'cask', and has to be installed with the --cask
flag:
The --no-quarantine
option is needed because Alacritty isn’t part of the Apple developer program. Otherwise you might get this error:
Check your version with the capital V:
And upgrade Alacritty if needed:
Setup terminfo
From the docs:
To make sure Alacritty works correctly, either the alacritty
or alacritty-direct
terminfo must be used. The alacritty
terminfo will be picked up automatically if it is installed.
Test if you got terminfo installed:
Clone Alacritty because we need bits from it, and hop into the dir:
Then setup terminfo:
Configuring Alacritty
Config is done with a YAML file that lives in ~/.config/alacritty/alacritty.yml
. This is great, because now you can keep the config in your dotfiles and share it between machines, which you can’t do with iTerm for example.
My config is pretty default, but I’ve cherry picked few things to highlight here. See the full config below.
Copying with mouse
Copy the selected text to system clipboard without having to press Cmd/Ctrl+c:
Remapping alt for your keyboard layout
This mapping is for British keyboard layout. This is needed so that you can type hashes in Vim for example, which is Alt+3.
See this thread in GitHub for more examples. And a this Wiki entry for more keyboard configs for layouts like German, Swiss, Italian, Spanish, Portuguese...
Handle fish shell
If you’re on fish, tell Alacritty about it:
Get the path to your fish with $ which fish
.
Then set the fish completion by grabbing the alacritty.fish
completion mapping from the Alacritty repo we cloned earlier:
Clickable URLs
Make URLs clickable when Cmd is held down:
But why can’t I click URLs even if I have configured it the right way? You might be in a tmux session and have the mouse mode enabled, which captures clicks before Alactitty can see them. The mouse mode can disabled by pressing Shift, so Cmd+Shift click, should work.
Color themes
See a selection of color themes in the Alacritty repo.
Alacritty Macos
Full config file
Alacritty Install
This is my full config at the time of writing this:
See all the options in the freshest config file on the releases page in Alacritty GitHub.
Keyboard shortcuts
Here’s the default ones on Mac:
Key | Command |
---|---|
Cmd+0 | ResetFontSize |
Cmd+Equals | IncreaseFontSize |
Cmd+Plus | IncreaseFontSize |
Cmd+Minus | DecreaseFontSize |
Cmd+K | ClearHistory |
Cmd+V | Paste |
Cmd+C | Copy |
Cmd+C | ClearSelection |
Cmd+H | Hide |
Cmd+M | Minimize |
Cmd+Q | Quit |
Cmd+W | Quit |
Cmd+N | SpawnNewInstance |
Cmd/Ctrl+F | ToggleFullscreen |
Cmd+F | SearchForward |
Cmd+B | SearchBackward |
You can’t pull down 'File' and choose 'New Window', but there’s a default keybinding spawn an new instance Cmd+N. That can be remapped to Cmd+Shift+N for example, with the pipe |
you can add modifiers:
The Vi mode
Alactitty has Vi mode. Meaning: you can navigate the prompt with hjkl like in Vim. You can turn the Vi mode with Ctrl+Shift+Space, and exit the Vi mode with the same shortcut.
To copy text in Vi mode, press v and highlight the text you want, then press y (yank) to copy it to your systems clipboard. You can also use mouse to copy text like a normal person.
Using Alacritty
It’s a terminal emulator, so you don’t really use it, you use other programs with it. But you can issue the alacritty
command, which will pop out a new window:
You can also start a new Alacritty session using a different config file:
Check the help to see all the flags and options:
Install Alacritty On Mac
Juice it up with Tmux
Since Alacritty is so frugal with features, you really need Tmux (or screen) to go with it.
Install Alacrity Terminal For Macos Catalina
I have a full post about tmux which has all the good stuff.
But below is the really basics.
Install:
Pop open a tmux session:
Tmux is all about the keyboard shortcuts, everything starts with a Ctrl+b then followed by a key. For example Ctrl+b % splits your pne into two. Ctrl+b c opens a new window (analogous to a tab). Ctrl+b n goes to the next window, Ctrl+b p to the previous. Check out my above mentioned post about tmux for more details.
Conclusions
Alacritty is pretty easy in the sense that you set it and forget it, it doesn’t need much attention. It took me a while to figure out tmux, though. But tmux is a good program to know, you can carry that knowledge over to other environments.
And by the way; even tho I say it’s 'nihilist', I really love Alacritty ❤️
Alacritty is the fastest terminal emulator in existence. Using the GPU for rendering enables optimizations that simply aren’t possible without it. Alacritty currently supports macOS, Linux, BSD, and Windows.
ALSO READHOW TO: Easily Apply and Change Alacritty Themes
Alacritty is a terminal emulator with a strong focus on simplicity and performance. With such a strong focus on performance, included features are carefully considered and you can always expect Alacritty to be blazingly fast. By making sane choices for defaults, Alacritty requires no additional setup. However, it does allow configuration of many aspects of the terminal.
To install it on macOS, use homebrew and the following command brew cask install alacritty.
For more info on Alacritty and how to install it on other OS’ ( Arch, Fedora, Pop! OS, Free BSD, Windows etc ) check out the official project page on GitHub.
The video below is a youtube-nocookie embed. If you don’t want to use YouTube, check out the video on invidious.