Alacritty is the fastest available Linux terminal emulator. It makes use of GPU (Graphical Processing Unit) for rendering ensuring optimization which would not be achieved without. Alacritty is a free,opensource and cross-platform, available for Linux, MacOS, Windows and BSD.

Alacritty strongly focuses on simplicity and performance. To ensure performance, included features are carefully selected and is expected to be faster than any other terminal emulator. To make it easy, Alacritty does not allow configuration and some aspects found in other terminal emulators. The software is also not yet complete and you would expect some features missing or bugs to be fixed but it is already being used by many.

Features of Alacritty Terminal Emulator

  • Vi mode – allows moving around Alacritty’s viewport and scrollback using the keyboard. Also serves as a jump-off point for other features such as search. Can be launched with ctrl shift space.
  • Motion – By default, cursor motion is set up to mimic vi but can also be configured otherwise.
  • Selection – An important feature of vi mode is the ability to select and copy to clipboard. Selection is started with v by default and copy with y. All selections available with the mouse are accessed from vi mode, some of which include semantic Alt + v, line shift + v and block selection ctrl + v.
  • Opening URLs – In vi mode, URLs can be opened by pressing Enter. Texts recognized as urls are underlined once you move vi cursor there.
  • Search – With search, you can find anything in Alacritty’s scrollback buffer. Search forward using ctrl+shift+f of backwards with ctrl+shift+b
  • Vi search – In vi mode, use / for forward search and ? For backward, allowing one to move freely and quickly. SearchStart and SearchEnd keybinding actions can be bound for jumping to the start or the end of a match.
  • Normal search – Here, you will not move freely but you can still jump between matches using Enter and Shift+Enter. You can leave search with Escape and the active match remains selected for you to copy.
  • Selection expansion – Once you make a selection, use the right mouse to expand. Double-clicking expands the selection semantically, while triple-clicking does line selection. If you hold ctrl while expanding the selection, it will switch to the block selection mode.

Installing Alacritty on Linux

Alacritty can be installed using package managers on Linux, BSD, macOS and Windows. To install Alacritty on Linux, run the following commands depending on your distribution. Note that some distributions already include Alacritty binaries in their repository. If not you can run the below commands to install.

----------- [Arch Linux] ----------- 
sudo pacman -S alacritty   

----------- [Fedora Linux] ----------- 
sudo dnf copr enable pschyska/alacritty 
sudo dnf install alacritty 

----------- [Debian and Ubuntu] ----------- 
sudo add-apt-repository ppa:mmstick76/alacritty 
sudo apt install alacritty

You can get prebuilt binaries for macOS and Windows to download on Github releases page.

Building Alacritty from source

In order to build Alacritty from source, we are going to follow the steps as below. Before compiling we need to first clone Alacritty source code and change into that directory:

git clone https://github.com/jwilm/alacritty.git 
cd alacritty 

Install Required Dependencies

Rust compiler is required for the installation of Alacritty. Install Rust programming language with rustup installer script.

$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

----
The cargo, rustc, rustup and other commands will be added to 
Cargo's bin directory, located at: 

 /home/lorna/.cargo/bin 

This path will then be added to your PATH environment variable by 
modifying the profile file located at: 

 /home/lorna/.profile 

You can uninstall at any time with rustup self uninstall and 
these changes will be reverted. 

Current installation options: 
default host triple: x86_64-unknown-linux-gnu 
    default toolchain: stable (default) 
              profile: default 
 modify PATH variable: yes 

1) Proceed with installation (default) 
2) Customize installation 
3) Cancel installation 
>1 

info: profile set to 'default' 
info: default host triple is x86_64-unknown-linux-gnu 
info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu' 
info: latest update on 2020-11-19, rust version 1.48.0 (7eac88abb 2020-11-16) 
info: downloading component 'cargo' 
info: downloading component 'clippy' 
info: downloading component 'rust-docs' 
info: downloading component 'rust-std' 
22.0 MiB /  22.0 MiB (100 %)  17.3 MiB/s in  1s ETA:  0s 
info: downloading component 'rustc' 
66.2 MiB /  66.2 MiB (100 %)  19.3 MiB/s in  5s ETA:  0s 
info: downloading component 'rustfmt' 
info: installing component 'cargo' 
info: Defaulting to 500.0 MiB unpack ram 
 5.2 MiB /   5.2 MiB (100 %)   4.9 MiB/s in  1s ETA:  0s 
info: installing component 'clippy' 
info: installing component 'rust-docs' 
13.3 MiB /  13.3 MiB (100 %)   1.1 MiB/s in 16s ETA:  0s 
info: installing component 'rust-std' 
22.0 MiB /  22.0 MiB (100 %)   2.0 MiB/s in 34s ETA:  0s 
info: installing component 'rustc' 
66.2 MiB /  66.2 MiB (100 %)   5.5 MiB/s in 15s ETA:  0s 
 4 IO-ops /   4 IO-ops (100 %)   1 IOPS in  4s ETA:  0s     
info: installing component 'rustfmt' 
info: default toolchain set to 'stable' 

 stable installed - rustc 1.48.0 (7eac88abb 2020-11-16) 


Rust is installed now. Great! 

To get started you need Cargo's bin directory ($HOME/.cargo/bin) in your PATH 
environment variable. Next time you log in this will be done 
automatically. 

To configure your current shell run source $HOME/.cargo/env

Install Required Libraries

Next, we will install some libraries needed for building Alacritty.

--------- On Ubuntu/Debian --------- 
sudo apt-get install cmake pkg-config libfreetype6-dev libfontconfig1-dev libxcb-xfixes0-dev python3

--------- On CentOS/RHEL --------- 
sudo yum install cmake freetype-devel fontconfig-devel libxcb-devel xcb-util-devel
sudo yum group install "Development Tools"


--------- On Fedora --------- 
sudo dnf install cmake freetype-devel fontconfig-devel libxcb-devel g++

--------- On Arch Linux --------- 
sudo pacman -S cmake freetype2 fontconfig pkg-config make libxcb

Building Alacritty Terminal Emulator

To build Alacritty terminal emulator on Linux, run the command below while still in Alacritty directory.

#Linux/ Window
cargo build --release 

#On MacOS, run 
make app
cp -r target/release/osx/Alacritty.app /Applications/

Set desktop entry

Most Linux and BSD distributions support desktop entries for adding applications to system menus. The commands below will install the desktop entry for Alacritty:

sudo cp target/release/alacritty /usr/local/bin # or anywhere else in $PATH
sudo cp extra/logo/alacritty-term.svg /usr/share/pixmaps/Alacritty.svg
sudo desktop-file-install extra/linux/Alacritty.desktop
sudo update-desktop-database

Next, we install manual pages:

sudo mkdir -p /usr/local/share/man/man1
gzip -c extra/alacritty.man | sudo tee /usr/local/share/man/man1/alacritty.1.gz > /dev/null

Configure Alacritty Shell Completions

To add shell completions for Bash, Zsh and Fish, we run the below commands

--------- On Bash Shell --------- 
# If you do not plan to delete the source folder of alacritty, you can run
echo "source $(pwd)/extra/completions/alacritty.bash" >> ~/.bashrc

# Otherwise you can copy it to the ~/.bash_completion folder and source it from there:
mkdir -p ~/.bash_completion
cp extra/completions/alacritty.bash ~/.bash_completion/alacritty
echo "source ~/.bash_completion/alacritty" >> ~/.bashrc

--------- On ZSH Shell --------- 
#If you do not already have such a directory registered through your ~/.zshrc, you can add one like this:
mkdir -p ${ZDOTDIR:-~}/.zsh_functions
echo 'fpath+=${ZDOTDIR:-~}/.zsh_functions' >> ${ZDOTDIR:-~}/.zshrc
#  Then copy the completion file to this directory:
cp extra/completions/_alacritty ${ZDOTDIR:-~}/.zsh_functions/_alacritty


--------- On FISH Shell --------- 
# cp alacritty-completions.fish /usr/share/fish/vendor_completions.d/alacritty.fish

On your system applications, you should be able to see Alacritty added to your desktop.

That’s it. You have successfully installed and configured Alacritty terminal emulator on Linux, Windows and MacOS. Have fun with the tool! Below are more interesting guides:

LEAVE A REPLY

Please enter your comment!
Please enter your name here