10

My alacritty config file is in ~/.config/alacritty/alacritty.yml with the following font settings:

# Font configuration
font:
  
  [...]

  # Point size
  size: 10.0

All other font configuration options are commented out. I verified that alacritty is indeed reading this config file using the -vvv flag.

However, whenever I open a new terminal window the font seems to be selected at random. Below a picture of two windows opened one right after the other.

enter image description here

Mike Pennington
  • 41,899
  • 19
  • 136
  • 174
Luís de Sousa
  • 5,765
  • 11
  • 49
  • 86

2 Answers2

14

This problem is now reported as an issue at the alacritty repository. In general alacritty seems to have many issues with font sizes across different systems.

However, in trying to identify the cause I found that with the -vv flag alacritty always starts the terminal with a font size exactly the double of that in the config file.

So for now it is possible to work around this issue by setting up the font size at half of the desired in the config file. For instance, to obtain a font size of 14:

# Font configuration
font:
  
  [...]

  # Point size
  size: 7.0

And then start alacritty with the -vv flag:

$ alacritty -vv
Luís de Sousa
  • 5,765
  • 11
  • 49
  • 86
  • This workaround does not function on Ubuntu 22.04 with alacritty 0.10.1. Will update this answer if some other workaround comes by. – Luís de Sousa May 26 '22 at 13:22
  • I am running `alacritty 0.10.1 (2844606)` on MacOS and do not have a problem adjusting the font size in the yml config... no `-vv` required... – Mike Pennington Jul 01 '22 at 14:41
5

Possible workaround is to use -o flag when running alacritty and set font.size to desired value. Can be done through .bash_aliases or your WM config to make it faster to use.

Example:

alacritty -o font.size=8

Btw. I couldn't reproduce random font selection but I had problem with setting custom font size through alacritty config file.

  • 3
    This worked for me. A terminal emulator in 2022 without a clean instruction to set font size, cool. – ᐅdevrimbaris Apr 13 '22 at 13:16
  • 1
    If you issue that command with the `-vv` flag in addition you can see in the debug output that alacritty is nor selecting that font size but something else. However, your suggestion is actually useful to i3 users like myself. – Luís de Sousa May 26 '22 at 13:25