Alacritty

From Gentoo Wiki
Jump to: navigation, search
Resources
Article status
This article has some todo items:
  • Add more info
  • Tips and tricks
This article is a stub. You can help by expanding it.
Important
As of December 2018, Alacritty is still in its alpha stage of development[1].

Alacritty is a terminal emulator focused on simplicity and performance. The performance goal means it should be faster than any other terminal emulators available. The simplicity goal means it doesn't have features such as tabs or splits (which can be better provided by a window manager)[2].

Alacritty is written in Rust and GPU-accelerated using OpenGL.

USE fags

USE flags for x11-terms/alacritty GPU-accelerated terminal emulator

Installation

Emerge

Install x11-terms/alacritty package:

root #emerge --ask x11-terms/alacritty

Configuration

Files

Following paths are searched for configuration:

  • $XDG_CONFIG_HOME/alacritty/alacritty.yml
  • $XDG_CONFIG_HOME/alacritty.yml
  • $HOME/.config/alacritty/alacritty.yml
  • $HOME/.alacritty.yml

If no configuration is found then $XDG_CONFIG_HOME/alacritty/alacritty.yml is created on the first run. On most systems this path defaults to: $HOME/.config/alacritty/alacritty.yml.

The default configuration file get installed into /usr/share/doc/alacritty-<version>/ directory.

Important
The configuration file is YAML -formatted. Preserving the indentation is critical.

Many configuration options will take effect immediately upon saving the config file. Exception are the font and dimensions sections which requires Alacritty to be restarted.

For detailed explanation of the config file, please consult the comments in the default config file.

Choosing a font

Since Alacritty is configured by editing a configure file by hand, users can't just choose a font from a submenu. This might cause some problems since one needs to supply the exact font name for Alacritty.

To make things easier users can run following command and just copy and paste the desired font name:
user $fc-list -f '%{family}\n' | awk '!x[$0]++'

Since Alacritty configuration auto load feature doesn't work when changing font, users can try out different fonts easily by starting alacritty from a terminal by issuing following command:

user $alacritty --config-file <(echo -ne 'font:\n  size: 12\n  normal:\n    family: DEC Terminal') -e htop

That would start alacritty with size 12 "DEC Terminal" as font.

Note
This method uses defaults for all other settings.

Troubleshooting

Font is too small or big

Status of this caveat can be tracked under: Issue #1501.

Colors

... are weird

By default alacritty has not the font colors users would normally expect. Users need to configure Alacritty's color settings to the desired effect.

Here's a good starting point which some users may find sufficient:

FILE ~/.config/alacritty/alacritty.ymlpart of the config file
# All the color setting are under the "color" section.
colors:
 
  # Normal colors
  normal:
    black:   '0x000000'
    red:     '0xBB2222'
    green:   '0x22BB22'
    yellow:  '0xBBBB22'
    blue:    '0x2222BB'
    magenta: '0xBB22BB'
    cyan:    '0x22BBBB'
    white:   '0xDDDDDD'
 
  # Bright colors
  bright:
    black:   '0x888888'
    red:     '0xFF2222'
    green:   '0x22FF22'
    yellow:  '0xFFFF22'
    blue:    '0x2222FF'
    magenta: '0xFF22FF'
    cyan:    '0x22FFFF'
    white:   '0xFFFFFF'

Prompt ($PS1) is colorless and $LS_COLORS is unset

This is an issue with dircolors[3].

Note
This may not work with other shells than bash.

Since at least in bash shell the default /etc/bash/bashrc checks the terminal color capability by running dircolors, users may add TERM alacritty -line into /etc/DIR_COLORS -file into a place where all other TERM lines reside at the beginning of the file. This assumes user hasn't done any significant changes to the /etc/DIR_COLORS -file prior to this change. However, a bug report has been submitted[4]. So in future alacritty might be included in /etc/DIR_COLORS by default.

See also

  • Terminal emulator — emulates a video terminal within another display architecture (usually X).

External resources

References

  1. alacritty/README.md at master · jwilm/alacritty, github.com. Retrieved on December 6, 2018
  2. Joe Wilm, Announcing Alacritty, a GPU-accelerated terminal emulator, jwilm.io. Retrieved on December 6, 2018
  3. Alacritty terminfo is not compatible with GNU dircolors - issue #2210
  4. coreutils bug#35247