I'm using Windows Subsystem for Linux (WSL 2) with Oh My Zsh to pimp my bash, but I can't make the Ubuntu terminal render the Powerline fonts properly. Any idea on how to set up WSL to work with these fonts?
How to install Powerline fonts on WSL?
48.5k views Asked by Nícolas Iensen At
4
There are 4 answers
1
On
- Download the required .ttf file from the powerline github repo.
- In Windows, open the file by double-clicking on it. It will show two
options:
Print
andInstall
. ChooseInstall
. - Right-click on the WSL terminal's title-bar > Properties > Font > DejaVu Sans Mono for Powerline.
1
On
A simple way would be to add Powerline fonts to Windows and then using them in the terminal.
Basically, Powerline fonts will get installed at ~/.local/share/fonts
inside WSL. These fonts can be copied to someplace on your windows directory.
e.g.
cp ~/.local/share/fonts/* /mnt/d/fonts/
This will copy all the ttf
files to a folder names fonts
on my d drive.
Now press that windows icon from your keyboard and search for Font Settings
.
Under Add Fonts
, you can drag and drop the ttf
files. Windows will automatically install all these fonts. You can then go to your Terminal and set the required font.
I was installing the fonts in the Ubuntu system, but it is Windows that is rendering the characters from the terminal, so I should install the fonts on Windows (facepalm).
I followed this blog post to install the Powerline fonts on Windows, and then I had to change the font in the settings of the WSL terminal:
I selected the font DejaVu Sans Mono for Powerline, which works well with the robbyrussell theme of Oh My Zsh, but there are other options.
Running the same command now rendered the characters as expected:
The shell command I used to test the Powerline fonts came from this GitHub gist.