Sunday, May 10, 2026

Alacritty with Terminus On MacOS

Getting Alacritty to render Terminus font nicely along with having those nice nerd font symbols on MacOS  turned out to be much more of a hassle then I ever expected it to be.  With iTerm2, it was simply a matter of installing the Terminess Nerd Font and disable anti-aliasing, but with Alacritty there's a lot more steps involved.

Installing Terminus


Installing Terminus on MacOS can be done through Brew for both Terminus TTF and Terminess (the Nerd Font equivalent).  Make sure to do the following:
  1. Go to Font Book and check that the fonts are all activated.
  2. Make sure you have the right family name and style as Alacritty is case sensitive and both needs to be entered into the config exactly or Alacritty will give you a misleading error message.

Disabling Anti-Aliasing


Terminus is a font that might look worse with anti-aliasing.  Both the Terminus TTF and Terminess did not look as clear and as sharp compared to what I'm used to.  iTerm has a checkbox to turn it off but Alacritty requires you to do this from the OS:
defaults write org.alacritty AppleFontSmoothing -int 0
To turn it back on:  
defaults delete org.alacritty AppleFontSmoothing

Installing a Better Terminus


Alacritty couldn't render either of the above fonts very clearly.  On programmingfonts.org, I found another Terminus font that looked nice on the browser called Consoleet Terminus



I installed it on to MacOS but getting Alacritty to recognize it had me pulling out my hair.

[font]
size = 18.0
normal = { family = "Consoleet Terminus-18", style = "medium" }
bold = { family = "Consoleet Terminus-18", style = "bold" }
Notice what's unusual about the configuration that finally worked in Alacritty?  Some Terminus fonts don't have "Regular" styles and only define it as "Medium".  In the case of Consoleet Terminus, the styles are all lowercase.  If it is capitalized (e.g. "Medium" instead of "medium") then there will be an error.

I finally got the same nice looking terminal except it doesn't have those Nerd Font symbols.

 Installing Nerd Font Symbols


On Linux, it is easy to tell it that if a font doesn't have a symbol to go to a fallback font that does have it and use that one.  MacOS doesn't allow that so I had to merge a font that has it into Consoleet Terminus.  The problem is that most fonts with the symbols are scalable while classic version of Terminus fonts (like Consoleet) are not.   That's why you'll see individual font files for specific sizes.  In my case, the Consoleet em size is 36 units (ascent 30, descent 6) while Terminess will be 2048 — so the symbols are coming in roughly 56× too large.

The following script got me the right numbers to use to figure out what size I need to extract:
#!/usr/local/bin/bash
SYMBOL_REGULAR="$HOME/Library/Fonts/TerminessNerdFont-Regular.ttf"
SYMBOL_BOLD="$HOME/Library/Fonts/TerminessNerdFont-Bold.ttf"
mkdir -p ~/merged-fonts

declare -A SYMBOL_MAP=(
  [/Library/Fonts/consoleet_ter18nr.otf]="$SYMBOL_REGULAR|medium"
  [/Library/Fonts/consoleet_ter18br.otf]="$SYMBOL_BOLD|bold"
)

for f in "${!SYMBOL_MAP[@]}"; do
  IFS='|' read -r symbol style <<< "${SYMBOL_MAP[$f]}"
  name=$(basename "$f" .otf)
  family="Consoleet Terminus-18 Nerd"
  psname="ConsoleetTerminus18Nerd-${style}"
  fullname="${family} ${style}"

  cat > /tmp/merge.pe <<EOF
Open("$f")
Print("Destination em: " + \$em)
Print("Destination ascent: " + \$ascent + " descent: " + \$descent)
\$dst_em = \$em
\$dst_ascent = \$ascent
\$dst_descent = \$descent

Open("$symbol")
Print("Source em (before): " + \$em)
ScaleToEm(\$dst_ascent, \$dst_descent)
Print("Source em (after): " + \$em)
Generate("/tmp/scaled_symbol.ttf")
Close()

MergeFonts("/tmp/scaled_symbol.ttf")
SetFontNames("$psname", "$family", "$fullname", "$style")
Generate("$HOME/merged-fonts/${name}-merged.otf")
EOF
  fontforge -script /tmp/merge.pe
Then with the results, update the script to create the merged fonts:
#!/usr/local/bin/bash
SYMBOL_REGULAR="$HOME/Library/Fonts/TerminessNerdFont-Regular.ttf"
SYMBOL_BOLD="$HOME/Library/Fonts/TerminessNerdFont-Bold.ttf"
mkdir -p ~/merged-fonts

declare -A SYMBOL_MAP=(
  [/Library/Fonts/consoleet_ter18nr.otf]="$SYMBOL_REGULAR|medium"
  [/Library/Fonts/consoleet_ter18br.otf]="$SYMBOL_BOLD|bold"
)

for f in "${!SYMBOL_MAP[@]}"; do
  IFS='|' read -r symbol style <<< "${SYMBOL_MAP[$f]}"
  name=$(basename "$f" .otf)
  family="Consoleet Terminus-18 Nerd"
  psname="ConsoleetTerminus18Nerd-${style}"
  fullname="${family} ${style}"

  cat > /tmp/merge.pe <<EOF
Open("$f")
dst_ascent = \$ascent
dst_descent = \$descent
Print("Destination em: " + \$em + " ascent: " + dst_ascent + " descent: " + dst_descent)

Open("$symbol")
Print("Source em (before): " + \$em)
ScaleToEm(dst_ascent, dst_descent)
Print("Source em (after): " + \$em)
Generate("/tmp/scaled_symbol.ttf")
Close()

Open("$f")
MergeFonts("/tmp/scaled_symbol.ttf")
SetFontNames("$psname", "$family", "$fullname", "$style")
Generate("$HOME/merged-fonts/${name}-merged.otf")
EOF
  fontforge -script /tmp/merge.pe
Done

Once the script is run, validate it first:
fc-scan --format "%{family}\n%{fullname}\n%{postscriptname}\n%{style}\n" ~/merged-fonts/consoleet_ter18nr-merged.otf
fc-scan --format "%{family}\n%{fullname}\n%{postscriptname}\n%{style}\n" ~/merged-fonts/consoleet_ter18br-merged.otf
If there are no errors then install and validate:
cp ~/merged-fonts/consoleet_ter18*-merged.otf ~/Library/Fonts/
fc-match "Consoleet Terminus\-18 Nerd"
fc-match "Consoleet Terminus\-18 Nerd:style=bold"
Your final alacritty.conf file will be:
[font]
size = 18.0
normal = { family = "Consoleet Terminus-18 Nerd", style = "medium" }
bold = { family = "Consoleet Terminus-18 Nerd", style = "bold" }
Restart Alacritty.

 

Monday, May 4, 2026

Chrome and Fedora Crashes With Multi-Monitor Setup

 I've noticed with more frequency that after waking from sleep, Chrome or some of its tabs will crash.  It can happen immediately or shortly after.  A kernel crash or system freeze  happens less frequently but is more disruptive when they happen.


This is happening on my main system that has 3 monitors (2 are 120Hz), an AMD CPU with integrated graphics and a discrete Nvidia GPU.  The monitors are connected to the motherboard (1 HDMI and 2 DisplayPort that are daisy-chained) rather than to the discrete graphics so I can preserve as much VRAM for LLM inference.

Initially, I though the culprit was the Nvidia driver since the most common responses on the Internet mention them.  The next most common response was to turn off hardware acceleration in Chrome. 

chrome://gpu revealed that the iGPU was only being allocated 512MB of memory which not enough with a multi-monitor setup.  This was being automatically set in the BIOS so I changed the UMA Frame Buffer Size (Found under NB Configuration)  to 1GB.

Next, Chrome showed it knew there are two graphics option so this tells it to almost use the integrated graphics.  

google-chrome-stable --disable-gpu-driver-bug-workarounds --gpu-testing-vendor-id=<vendor id> --gpu-testing-device-id=<device id>

There are some settings for the Nvidia card that might also improve stability.  Edit /etc/modprobe.d/nvidia.conf and add the following settings might improve stability but might also slow waking up:

options nvidia "NVreg_PreserveVideoMemoryAllocations=1"
options nvidia "NVreg_TemporaryFilePath=/var/tmp"
options nvidia "NVreg_EnableS0ixPowerManagement=1"
options nvidia "NVreg_PreserveVideoMemoryAllocations=1"

To make sure the system leverage these values:

sudo dracut -f 
sudo reboot

Tip: Restart the Cinnamon process without losing your open windows by pressing Alt + F2, typing r, and hitting Enter