-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
icons don't display in VS code integrated terminal after setting terminal.integrated.fontFamily #671
Comments
You can find similar instructions for all popular terminals in this document: https://github.com/romkatv/powerlevel10k/blob/master/font.md |
@Joey-Provolone, if you fixed it, can you post also here the solution? |
@sortega The instructions in my previous comment should work: #671 (comment) |
You are 100% correct |
That will disable the integrated terminal altogether. Many VS Code users (myself included) like to have a terminal integrated within the IDE. |
or just add the following lines to settings.json:
example: |
I came from google. This worked perfectly, thank you! |
this was necessary for me as well, thanks (ps official instructions were not sufficient)) |
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. |
Works fine for me in powerlevel10K on Mac. |
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. |
@HarishChandran3304 You must have skipped steps in the instructions that tell you to install the font. The first two steps here: #671 (comment). You need to perform all steps without skipping any. |
@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. |
Where did you copy the ttf files to make it work? |
Inside the usr/share folder |
Please be more specific. |
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. |
Thanks! That would be It's unlikely that copying the fc-list 'MesloLGS NF' |
Ahh okay got it! I too felt that it was highly unlikely that copying the 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 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 To uninstall snap version of VS Code: $ snap remove code To install the .deb file: $ sudo apt install /path/to/package/name.deb Also, all my VS Code preferences, settings, and extensions were preserved, so I don't think reinstalling should be a problem for others! |
Oh wait oops! I forgot to send the output you were looking for. ~ fc-list 'MesloLGS NF' ✔
/home/harish/.local/share/fonts/MesloLGS NF Bold.ttf: MesloLGS NF:style=Bold
/home/harish/.local/share/fonts/MesloLGS NF Italic.ttf: MesloLGS NF:style=Italic
/home/harish/.local/share/fonts/MesloLGS NF Bold Italic.ttf: MesloLGS NF:style=Bold Italic
/home/harish/.local/share/fonts/MesloLGS NF Regular.ttf: MesloLGS NF:style=Regular |
Thanks for the link. This issue has been fixed in 2019. Ubuntu 20.04 shouldn't be affected.
Hm... microsoft/vscode#63194 (comment) says this:
You've copied the files to Can you double-check the whole thing? Uninstall VS Code, install it from Snap Store and verify that it can use MesloLGS NF. Then delete the ttf files from |
@chrisdemars That ugly font on your screenshot is the fallback font. VS Code uses it when the font specified in the VS Code settings does not exist. This can happen if you haven't installed the font or if you've mistyped its name in VS Code settings. |
@romkatv I have it spelled the exact same. I am using "MesloGS NF". I am wondering if at this point it is a bug in VS Code. |
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! 👍🏾 |
Arch Linux here: |
"MesloLGS Nerd Font" is not the same font as "MesloLGS NF". The latter is the recommended font with properly sized icons. |
I installed my Nerd Font with Homebrew and hat to put
|
That's not the recommended font though. You can use it if you like it: powerlevel10k works with any font. The recommended font is basically the same but with properly sized icons. |
because font not downloaded or not configured... 1-download MesloLGS NF Regular font |
I tried that mate, I'm getting this same problem with any nerd font I tried 5 of them. |
@Welding-Torch Try following the instructions very carefully. |
@romkatv Okay. I've followed along once again, and unfortunately I'm getting the same result: Can someone recommend a fix? |
@Welding-Torch This does not look like a Powerlevel10k prompt. |
Don't forget to restart VS Code if you've newly installed the font. :) |
I wantd to install the font none of the suggestions were working, only when I added this collection of options did it start working
|
You spelled |
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 |
I'm having this issue as well (even if I use if [[ "$TERM_PROGRAM:l" = vscode* ]]; then
. ~/.p10k.vscode.zsh
else
. ~/.p10k.zsh
fi then copy the file, restart the VS Code terminal, and verify the config file & reconfigure: echo $TERM_PROGRAM # Should be vscode
echo $POWERLEVEL9K_CONFIG_FILE # Shoulc be /Users/.../.p10k.vscode.zsh
p10k configure |
Great thanks! Just a comment here, but if you are using the fonts downloaded from homebrew, which are nice since you get updates, you need to write there |
This indicates you are using a different font, not the recommended one. If you download the recommended font from any source (including homebrew: |
Cask fonts has been deprecated https://github.com/Homebrew/homebrew-cask-fonts I'm using the cask https://github.com/Homebrew/homebrew-cask/blob/HEAD/Casks/font/font-m/font-meslo-lg-nerd-font.rb
|
My comment still stands. If you install the recommended font from any source, its name will be "MesloLGS NF". If your font has a different name, it's a different font. |
Can you tell me what I'm doing wrong when the creator of the font is recommending using the installation method I use? https://github.com/ryanoasis/nerd-fonts?tab=readme-ov-file#option-2-homebrew-fonts In other words, If you use the regular homebrew install, if you're using homebrew, most probable patch, you are going to have that name. I'm not stating that there is wrong or right… but that the name could be different. PS/ just clarifying that the name could be different depending on the install you have would be nice. |
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. |
As far as I understand you need to use a mono font on terminal. Visual Studio Code was not allowing me to use the non mono one, which I also have installed. |
That may be true but my point still stands. |
This is what I did:
|
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 SolutionI 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 |
For all those with a different problem like me: Problem:I was encountering an issue where my ZSH prompt configuration ( 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:
in a file called Finally I had the following in my if [[ "$ITERM_PROFILE" ]]; then
# Load Powerlevel10k and Oh-My-Zsh configuration here... This caused VSCode's integrated terminal to skip loading the oh-my-zsh configuration because the environment variable However, since the conditional block in Solution:Simply add to the .zshrc logic. if [[ "$TERM_PROGRAM" == "vscode" || "$ITERM_PROFILE" ]]; then |
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!
The text was updated successfully, but these errors were encountered: