First of all, why?
Most modern shell prompts use particular fonts (e.g. Powerline, NerdFonts, etc.) which are designed to enhance the visual appearance of terminal applications by providing additional symbols, icons, and glyphs. If you don't have this type of font installed in your system you won't be able to see those special symbols.
How to fix it?
The fix is pretty straightforward. You will find yourself in one of the following two cases.
[Case 1] It looks fine inside my everyday terminal but not in VSCode
This is the easy one. Most probably you just have to tell VSCode to use your terminal font.
Find out and copy your everyday terminal font
- Open the terminal you usually use outside of VSCode. For instance, if you are on MacOS and you're using iTerm2, go to
iTerm2 › Preferences › Profiles › Text
and copy the Font Name
(e.g. MesloLGS NF
)
Set the terminal font on VSCode
- Open File → Preferences → Settings (PC/Linux) or Code → Settings... → Settings (Mac)
- Enter
terminal.integrated.fontFamily
in the search box at the top of Settings tab
- Set the font name you copied at the previous step into the
Terminal › Integrated: Font Family
field
[Alternatively] Modify the VSCode settings.json
file and add
{
...,
"terminal.integrated.fontFamily": "MesloLGS NF"
}
Done! 🎉 Now you should see every symbol correctly
[Case 2] I'm having font issues even in my everyday terminal
If this is the case you'll probably need to install a compatible font. I like and recommend Nerd Fonts but also Powerline Fonts or Fontawesome Fonts work totally fine.
Download and install a compatible font
- Download these four ttf files:
- Double-click on each file and click "Install". This will make
MesloLGS NF
font available to all
applications on your system.
Set the terminal font on VSCode
- Open File → Preferences → Settings (PC/Linux) or Code → Settings... → Settings (Mac)
- Enter
terminal.integrated.fontFamily
in the search box at the top of Settings tab
- Set
MesloLGS NF
as value into the Terminal › Integrated: Font Family
field
[Alternatively] Modify the VSCode settings.json
file and add
{
...,
"terminal.integrated.fontFamily": "MesloLGS NF"
}
Done! 🎉 Now you should see every symbol correctly
I don't like the MesloLGS NF font, how can I change it?
You can find many different compatible fonts, for instance here https://www.nerdfonts.com/font-downloads. Install them by downloading the tff files as explained and simply change the terminal font setting in VSCode to use them.
I recommend this site https://www.programmingfonts.org/#meslo which gives you a test drive of all the most used programming fonts!
default shell
tozsh
? – Penthousesudo fc-cache -vf /usr/share/fonts/
, if this doesn't work give the output of following terminal command:fc-list | grep -i "Meslo"
– Penthousesudo apt-get install fonts-powerline
and rebuild the font cache usingsudo fc-cache -vf /usr/share/fonts/
and recheck if it is installed usingfc-list | grep -i "Meslo"
– Penthousefonts-powerline
, rebuilt the font cache and rechecked if Meslo was present. Sadly still nothing.. – Boz~/.fonts
and copy the font you need to it. Clear the font cache again usingsudo fc-cache -vf
. – Penthouse