A cross-platform, OpenGL terminal emulator.
Go to file
Christian Duerr 6e1b9d8b25
Replace serde's derive with custom proc macro
This replaces the existing `Deserialize` derive from serde with a
`ConfigDeserialize` derive. The goal of this new proc macro is to allow
a more error-friendly deserialization for the Alacritty configuration
file without having to manage a lot of boilerplate code inside the
configuration modules.

The first part of the derive macro is for struct deserialization. This
takes structs which have `Default` implemented and will only replace
fields which can be successfully deserialized. Otherwise the `log` crate
is used for printing errors. Since this deserialization takes the
default value from the struct instead of the value, it removes the
necessity for creating new types just to implement `Default` on them for
deserialization.

Additionally, the struct deserialization also checks for `Option` values
and makes sure that explicitly specifying `none` as text literal is
allowed for all options.

The other part of the derive macro is responsible for deserializing
enums. While only enums with Unit variants are supported, it will
automatically implement a deserializer for these enums which accepts any
form of capitalization.

Since this custom derive prevents us from using serde's attributes on
fields, some of the attributes have been reimplemented for
`ConfigDeserialize`. These include `#[config(flatten)]`,
`#[config(skip)]` and `#[config(alias = "alias)]`. The flatten attribute
is currently limited to at most one per struct.

Additionally the `#[config(deprecated = "optional message")]` attribute
allows easily defining uniform deprecation messages for fields on
structs.
2020-12-21 02:44:38 +00:00
.builds Fix sr.ht clippy job 2020-11-10 15:47:49 +00:00
.github Fix CI upload assets tag matching 2020-11-25 01:31:21 +00:00
alacritty Replace serde's derive with custom proc macro 2020-12-21 02:44:38 +00:00
alacritty_config_derive Replace serde's derive with custom proc macro 2020-12-21 02:44:38 +00:00
alacritty_terminal Replace serde's derive with custom proc macro 2020-12-21 02:44:38 +00:00
docs Add blinking cursor support 2020-11-23 23:11:03 +00:00
extra Fix embedded _NET_WM_ICON on X11 2020-12-20 07:57:03 +00:00
scripts Switch to flamegraph-rs script 2020-01-27 02:30:23 +03:00
.agignore
.editorconfig Fix typo in .editorconfig 2020-12-14 06:46:28 +00:00
.gitattributes Add custom merge strategy for CHANGELOG.md 2020-02-15 13:25:02 +03:00
.gitignore Add editorconfig 2020-11-06 05:12:29 +03:00
CHANGELOG.md Replace serde's derive with custom proc macro 2020-12-21 02:44:38 +00:00
CONTRIBUTING.md Bump development version to 0.7.0-dev 2020-11-15 13:38:46 +00:00
Cargo.lock Replace serde's derive with custom proc macro 2020-12-21 02:44:38 +00:00
Cargo.toml Replace serde's derive with custom proc macro 2020-12-21 02:44:38 +00:00
INSTALL.md Fixed typo in INSTALL.md 2020-11-24 16:39:14 +00:00
LICENSE-APACHE Remove copyright notice from files 2020-06-06 21:49:14 +03:00
Makefile Add editorconfig 2020-11-06 05:12:29 +03:00
README.md Rework installation instructions 2020-08-07 14:13:41 +00:00
alacritty.yml Replace serde's derive with custom proc macro 2020-12-21 02:44:38 +00:00
rustfmt.toml Fix clippy issues 2019-08-16 01:33:49 +02:00

README.md

Alacritty

Alacritty Logo

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.

Alacritty running vim inside tmux

About

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.

The software is considered to be at a beta level of readiness -- there are a few missing features and bugs to be fixed, but it is already used by many as a daily driver.

Precompiled binaries are available from the GitHub releases page.

Features

You can find an overview over the features available in Alacritty here.

Further information

Installation

Alacritty can be installed by using various package managers on Linux, BSD, macOS and Windows.

Prebuilt binaries for macOS and Windows can also be downloaded from the GitHub releases page.

On Windows, Alacritty requires winpty to emulate UNIX's PTY API for versions older than Windows 10 (October 2018 Update) and Microsoft's VC++ redistributable. The winpty agent (winpty-agent.exe) must be in the same directory as the Alacritty executable and is available through the GitHub releases page.

For everyone else, the detailed instructions to install Alacritty can be found here.

Configuration

You can find the default configuration file with documentation for all available fields on the GitHub releases page for each release.

Alacritty doesn't create the config file for you, but it looks for one in the following locations:

  1. $XDG_CONFIG_HOME/alacritty/alacritty.yml
  2. $XDG_CONFIG_HOME/alacritty.yml
  3. $HOME/.config/alacritty/alacritty.yml
  4. $HOME/.alacritty.yml

Windows

On Windows, the config file should be located at:

%APPDATA%\alacritty\alacritty.yml

Contributing

A full guideline about contributing to Alacritty can be found in the CONTRIBUTING.md file.

Issues (known, unknown, feature requests, etc.)

If you run into a problem with Alacritty, please file an issue. If you've got a feature request, feel free to ask about it. Please just keep in mind Alacritty is focused on simplicity and performance, and not all features are in line with that goal.

Before opening a new issue, please check if it has already been reported. There's a chance someone else has already reported it, and you can subscribe to that issue to keep up on the latest developments.

FAQ

Is it really the fastest terminal emulator?

In the terminals we've benchmarked, Alacritty is either faster or way faster than the others. If you've found a case where this isn't true, please report a bug.

Why isn't feature X implemented?

Alacritty has many great features, but not every feature from every other terminal. This could be for a number of reasons, but sometimes it's just not a good fit for Alacritty. This means you won't find things like tabs or splits (which are best left to a window manager or terminal multiplexer) nor niceties like a GUI config editor.

macOS + tmux + vim is slow! I thought this was supposed to be fast!

This appears to be an issue outside of terminal emulators; either macOS has an IPC performance issue, or either tmux or vim (or both) have a bug. This same issue can be seen in iTerm2 and Terminal.app. I've found that if tmux is running on another machine which is connected to Alacritty via SSH, this issue disappears. Actual throughput and rendering performance are still better in Alacritty.

IRC

Alacritty discussion can be found in #alacritty on freenode.

Wayland

Wayland is used by default on systems that support it. Using XWayland may circumvent Wayland specific issues and can be enabled through:

env WINIT_UNIX_BACKEND=x11 alacritty

License

Alacritty is released under the Apache License, Version 2.0.