Alacritty - ArchWiki

# Alacritty

From ArchWiki
Jump to navigation Jump to search

Alacritty is a simple, GPU-accelerated terminal emulator written in Rust. It supports scrollback, truecolor, copy/paste, clicking on URLS, and custom key bindings.

## Installation

Install the alacritty package or alacritty-gitAUR for the development version.

## Configuration

Alacritty searches for a configuration file at the following places in this order:

- `$XDG_CONFIG_HOME/alacritty/alacritty.yml`
- `$XDG_CONFIG_HOME/alacritty.yml`
- `$HOME/.config/alacritty/alacritty.yml`
- `$HOME/.alacritty.yml`

Copy the example configuration file at `/usr/share/doc/alacritty/example/alacritty.yml` to one of those places and uncomment the settings you want to change. Most settings take effect as soon as you save the file.

### Colors

See [1] for a list of available color schemes. If your preferred color scheme is on the list, paste the provided code into your configuration file.

### Font

If you do not want to use your system’s default font, you can specify a different font by changing the following lines:

    font:
      normal:
        family: monospace
        style: Regular

      bold:
        family: monospace
        style: Bold

      italic:
        family: monospace
        style: Italic

      bold_italic:
        family: monospace
        style: Bold Italic

Substitute `monospace` with a font name from the output of

    $ fc-list : family style

Note that some fonts do not provide an `Italic` style but an `Oblique` style instead.

## Tips and Tricks

### Spawn new instance in same directory

Add the following lines to your configuration file to spawn a new instance of Alacritty in the current working directory by pressing `Ctrl+Shift+Enter`:

    key_bindings:
      - { key: Return,   mods: Control|Shift, action: SpawnNewInstance }

### "user@host:cwd" in Window Title Bar

The window title bar shows "Alacritty" unlike other terminal emulators under Arch, which by default show "user@host:cwd".

If you want the Arch default behavior to apply to all your users in Alacritty, you need to edit your `/etc/bash.bashrc` file.

Find the case statements which sets the `$PROMPT_COMMAND` for other terminals:

    case ${TERM} in

      xterm*|rxvt*|Eterm|aterm|kterm|gnome*)
         PROMPT_COMMAND=${PROMPT_COMMAND:+$PROMPT_COMMAND; }'printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/\~}"'

        ;;
      screen*)
        PROMPT_COMMAND=${PROMPT_COMMAND:+$PROMPT_COMMAND; }'printf "\033_%s@%s:%s\033\\" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/\~}"'
        ;;
    esac

Then edit the line `xterm*|rxvt*|Eterm|aterm|kterm|gnome*)` to add `alacritty` so that it reads `xterm*|rxvt*|Eterm|alacritty|aterm|kterm|gnome*)`.

## Troubleshooting

### Mouse not working properly in Vim

Add `ttymouse=sgr` to your `.vimrc` or switch to Neovim. Also see this issue.

Category:

- Terminal emulators