powerlevel10k: icons don't display in VS code integrated terminal after setting terminal.integrated.fontFamily
I recently installed oh-my-zsh and powerlevel10k in iTerm2. I installed the font through p10k config and it looks beautiful!!!
But when I try to apply the font to my VScode integrated terminal none of the icons display in the prompt.
"terminal.integrated.fontFamily": "MesloLGS NF",
but it makes no difference. I also tried to add the extra set of single quotes:
"terminal.integrated.fontFamily": "'MesloLGS NF'",
No matter what I’ve tried, nothing seems to fix the issue. After googling exhaustively, I turn to you. Thanks for your help!
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 128
- Comments: 121 (30 by maintainers)
Download these four ttf files:
Double-click on each file and click “Install”. This will make
MesloLGS NFfont available to all applications on your system.Open Settings in Visual Studio Code.
Enter
terminal.integrated.fontFamilyin the search box at the top of Settings tab and set the value below toMesloLGS NF.You can find similar instructions for all popular terminals in this document: https://github.com/romkatv/powerlevel10k/blob/master/font.md
Cmd+Shift+PSearch: Terminal Font Input: MesloLGS NF@sortega The instructions in my previous comment should work: https://github.com/romkatv/powerlevel10k/issues/671#issuecomment-621031981
That will disable the integrated terminal altogether. Many VS Code users (myself included) like to have a terminal integrated within the IDE.
@Joey-Provolone You can simply change terminal from integrated to external to make that work
or just add the following lines to settings.json:
example: { “terminal.external.osxExec”: “iTerm.app”, “terminal.integrated.shell.osx”: “/bin/zsh”, “terminal.integrated.fontFamily”: “MesloLGS NF” }
Visual Studio Code: Open File → Preferences → Settings, enter terminal.integrated.fontFamily in the search box and set the value to MesloLGS NF.
I tried all of these solutions and my integrated terminal still looks like this.
You are 100% correct
Hi @Joey-Provolone , What theme you are using? it’s beautiful! where can i find this background image?
I had the exact same problem on Ubuntu 20.04 and nothing worked. All I had to do was copy and paste the 4 .ttf files (MesloLGS NF Regular.ttf, MesloLGS NF Bold.ttf, MesloLGS NF Italic.ttf and MesloLGS NF Bold Italic.ttf) inside the usr/share folder to fix it.
Note for Arch Linux users:
yay -S ttf-meslo-nerd-font-powerlevel10ksudo pacman -S ttf-meslo-nerdfc-list | grep MesloLGSLinks:
You are a life saver my friend. Thank you so much. i was wondering why the fonts was displaying in my iterm2 but not VS Code.
Problem solved! 👍🏾
in my VScode it looks like the icons are half cut. any suggestions please??
To add, if someone is using Manjaro Linux KDE 20 or higher, the font family that worked for me was:
"terminal.integrated.fontFamily": "NotoSansMono Nerd Font"Ahh okay got it! I too felt that it was highly unlikely that copying the
*.ttffiles into the~/sharefolder made any difference. So I tried testing some things on my own. My hypothesis was that VS Code was unable to recognize externally installed fonts unless the.ttffiles were copied into the~/sharefolder.I reinstalled VS Code using the .deb file from the official website and then everything seemed to be working fine. So I looked around and found this issue which says VS Code installations made using “snap” (I’m not sure what that is yet, another package manager I believe) (I had installed VS Code using the “Ubuntu Software” application which I believe uses snap), had problems recognizing fonts. And they also say that they found a workaround by pasting the .ttf files into the
~/shareor the~/share/fontsfolder to make it work which is exactly what I had to do.If you can look this over and confirm this you can maybe add some extra instructions to tell the users to try pasting the .ttf files into either the
~/shareor the~/share/fontsfolder and if that doesn’t work they would have to reinstall VS Code using the .deb file from the official website using appropriate commands. These are the commands that I used just in case.To uninstall snap version of VS Code:
To install the .deb file:
Also, all my VS Code preferences, settings, and extensions were preserved, so I don’t think reinstalling should be a problem for others!
Cause of issue (when using iTerm2)
In my case, this was happening because I was using iTerm 2 as my terminal application, which has a set of fallback glyphs available by default, so some glyphs I thought were coming from my Nerd Font were actually provided by a backup set of powerline glyphs. The solution is to add the recommended font as a backup so that VSCode will look for any glyphs it can’t find in the main font in the backup font instead. This will provide the missing glyphs in the same way that iTerm does by default.
Example Solution
I changed the following setting in my VSCode settings.json
From:
To:
Note: This does require you to have installed the ‘MesloLGS NF’ font provided by powerline10k
Arch Linux here: installed ttf-meslo-nerd from https://archlinux.org/packages/extra/ then i had to specify MesloLGS Nerd Font in vscode settings json and not MesloLGS NF:
"terminal.integrated.fontFamily": "MesloLGS Nerd Font"I’ve updated the instructions in https://github.com/romkatv/powerlevel10k/blob/master/font.md based on the feedback from this issue and replaced my first comment with a copy so that future readers who stumble upon this issue get to the useful information quicker.
this was necessary for me as well, thanks (ps official instructions were not sufficient))
I came from google. This worked perfectly, thank you!
“MesloLGS Nerd Font” is not the same font as “MesloLGS NF”. The latter is the recommended font with properly sized icons.
Thank you so much FedericoCapaldo I don’t know how or why but this UI setting was overwriting what I had in my JSON. When I went to look at this, I saw that MesloLGS NF was not in quotes which was causing the issue. It works now FYI for anyone still having this issue
it worked for me
"terminal.integrated.fontFamily": "CaskaydiaCove Nerd Font",try this:
"terminal.integrated.gpuAcceleration": "canvas"worked for meHello, I am trying to set up the font in the VS Code on my mac. I did the following:
MesloLGS NFedit:
fc-list 'MesloLGS NF'output:For all those with a different problem like me:
Problem:
I was encountering an issue where my ZSH prompt configuration (
powerlevel10k) was not applied when running the ZSH shell in the VSCode integrated terminal, even though the setup worked fine in iTerm2. The primary symptom was that the custom ZSH theme (powerlevel10k) and plugin setup seemed to be ignored, resulting in a basic prompt when using VSCode.Cause of the Problem:
The primary source of the issue was that fact that a long time ago I followed oh-my-zsh’s recommendations and I split my zsh init processes in a bunch of .zsh files and symlinked all to a dotfiles repo. Namely, I had the following crucial line:
ZSH_THEME="powerlevel10k/powerlevel10k"in a file called
misc.zshfound somewhere under ~/.oh-my-zsh/custom/ like they recommend in their documentation (they load all extra .zsh files so you can organise them however you want)Finally I had the following in my
.zshrc:This caused VSCode’s integrated terminal to skip loading the oh-my-zsh configuration because the environment variable
ITERM_PROFILEis specific to iTerm2 and was not set when using VSCode’s terminal. As a result, oh-my-zsh and thepowerlevel10ktheme were not initialized in VSCode.However, since the conditional block in
.zshrcwas skipped in VSCode, the theme variable frommisc.zshwas never loaded.Solution:
Simply add to the .zshrc logic.
Different fonts have different names. The recommended font is called “MesloLGS NF”. You’ve installed a different font, which naturally has a different name.
If your goal was to install “MesloLGS Nerd Font Mono”, you aren’t doing anything wrong. If your goal was to install “MesloLGS NF” (the font that powerlevel10k recommends), then your mistake was installing a different font.
I had to use the fullname for font: MesloLGS Nerd Font
Yes, VSCode supports fallback fonts.
@romkatv Actually, I did finish all the steps without skipping any and the font was working just fine on my GNOME terminal. It was an issue only on VS Code.
Those two lines in your vsCode settings Json would be the fix i guess
"editor.fontFamily": "MesloLGS NF", "terminal.integrated.fontFamily": "MesloLGS NF",Yeah, I think it’s intentional 😃, ‘FiraCode Nerd Font Mono’ is also in there, if it doesn’t find ‘‘FuraCode Nerd Font Mono’’ it defaults to ‘Fira’. Idk if there is such a thing as FuraCode fonts, but as it’s working imma leave it for now
It’s a configuration i took from here: https://gitlab.com/pinage404/dotfiles/-/blob/main/dotfiles/config/Code/User/settings.json
because font not downloaded or not configured…
1-download MesloLGS NF Regular font 2-after that go to setting and search terminal.integrated.fontFamily and set it to MesloLGS NF
I installed my Nerd Font with Homebrew and hat to put
"terminal.integrated.fontFamily": "'MesloLGS Nerd Font'",Had the same problem but with: Cascadia Code When set the:
"terminal.integrated.fontFamily": "CaskaydiaCove Nerd Font"It worked.TLDR: Have to pul full name of the font.
You can only instruct vscode to use a font that you have installed. If you’ve installed MesloLGS Nerd Font but not MesloLGS NF, then you can instruct vscode to use the former but not the latter. If you install MesloLGS NF, you’ll be able to use it in vscode.
Indeed, but other terminal applications allow you to set a different way to handle symbols, apart from the terminal font face. For example: https://sw.kovidgoyal.net/kitty/conf/#opt-kitty.symbol_map
And Nerd Fonts provides a separate download only containing symbols, which you can use with that option.
Is there a way to achieve this in VS Code?
If you are unable to change the font in vscode, ask for help in places where people ask for help with vscode. The question is: How to change the font used by the integrated terminal in vscode. Note that zsh and powerlevel10k don’t enter the picture.
is perfect for my vs
MesloLGS NFmay not be the correct solution for everyone. It depends which font you have installed in your command line. For example mine wasInconsolata for Powerline.A more generic approach to solve the problem is:
iTermwindow and go⌘ + , > Profiles > Text > Fontand remember the font you found there. This procedure is different from you if you are not usingiTermCmd + Shift + P > search for "Settings UI" > Press Enter > search for "terminal.integrated.fontFamily"and add the font that you have on your command line which you have found in step 1.Ctrl + Backquoteor from the menu, and it should all work now.Instead of using patched font, you can simply define a fallback font like ‘icons-in-terminal’:
Re-configuring p10k solved for me, inside vscode integrated terminal:
p10k configureI had to restart VSCode for the new font changes to reflect, but it worked after that.
@romkatv I must be an idiot. HOW did I not see the “L” in “MesloL” lol? That fixed it!
Thanks! That would be
~/share– you can see that on the left side of your prompt.~stands for your home directory, so the full path is something like/home/username/share. You can see it by typingpwd.It’s unlikely that copying the
*.ttffiles to~/sharehas made any difference but it’s technically possible if you’d made non-trivial and unusual changes to your system. Let’s try to find out. Please post the output of the following command:Sorry about that! I’m new to Linux and I’m still not familiar with the directory system. I ll try my best to be more specific. When I open the file explorer in my root directory there a couple of the default folders like Desktop, Documents, Downloads, etc. And there is also another folder called share. That is where i copied the 4 .ttf files into to make it work.
This is what it looks like on my terminal: