Skip to content

Latest commit

 

History

History

6.Nerd_Fonts_On_TTYs

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Nerd fonts on TTYs

Nerd fonts allow to print to screen special characters inside your shell prompts so that you can obtain useful info directly from your terminal. They also often come with special character combinations that will modify the printed output with a "ligature", which I personally love to see.

Unfortunately, it's difficult to enable showing font ligatures on both terminal emulators and virtual TTYs because of their lack of support.

Terminal emulators

My terminal emulator of choice is WezTerm because it specifically supports font ligatures and it has great customization options.

In my dotfiles repo you can find the WezTerm configuration that I'm currently using to both enable ligatures and customize the appearance.

Virtual TTYs

The challenge here is to also enable nerd fonts on virtual TTY, which is not simple. The default Agetty instances are not able to correctly show special characters, so we need an alternative.

KMSCon is one. It's a bit buggy, but I use it so rarely that I can live with that. One of the bugs is that, upon exiting a shell session, the TTY does not reset itself and it hungs on a dead screen. The only way to reset it is to stop the kmsconvt@ttyX service, where X is the TTY number, from another terminal/TTY.

The package I installed is kmscon-patched-git because it's a more recent fork of the original project. I decided to install it on all TTYs with:

sudo ln -s '/usr/lib/systemd/system/[email protected]' '/etc/systemd/system/[email protected]'
sudo systemctl disable getty@tty1

Nerd Fonts

Nerd Fonts are usually mono-spaced fonts with special, graphic characters included that enable users to create fancy prompts and output legato characters, such as this screenshot:

WezTerm with nerd font

While most current terminal emulators support Nerd Fonts characters, almost none of them are able to display the ligatures. WezTerm is an awesome, highly configurable terminal emulator that can display font ligatures.

The font I use is Cascadia Code by Microsoft, installed with pacman to be displayed also in KMSCon.