romkatv / powerlevel10k

A Zsh theme
MIT License
45.21k stars 2.15k forks source link

icons don't display in VS code integrated terminal after setting terminal.integrated.fontFamily #671

Closed JoeNormyl closed 4 years ago

JoeNormyl commented 4 years ago

I recently installed oh-my-zsh and powerlevel10k in iTerm2. I installed the font through p10k config and it looks beautiful!!!

Screen Shot 2020-04-28 at 9 56 09 PM

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!

luispuerto commented 2 months ago

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 MesloLGS Nerd Font Mono for example.

romkatv commented 2 months ago

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 MesloLGS Nerd Font Mono for example.

This indicates you are using a different font, not the recommended one. If you download the recommended font from any source (including homebrew: brew tap homebrew/cask-fonts && brew install font-meslo-for-powerlevel10k), the name of the font will be "MesloLGS NF".

luispuerto commented 2 months ago

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

brew info font-meslo-lg-nerd-font

romkatv commented 2 months ago

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.

luispuerto commented 2 months ago

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.

romkatv commented 2 months ago

Different fonts have different names. The recommended font is called "MesloLGS NF". You've installed a different font, which naturally has a different name.

Can you tell me what I'm doing wrong

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.

luispuerto commented 2 months ago

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.

romkatv commented 2 months ago

That may be true but my point still stands.

KarstenVogt commented 1 month ago

This is what I did:

romkatv commented 1 month ago

@KarstenVogt https://github.com/romkatv/powerlevel10k/issues/671#issuecomment-2164736070

TobyDS commented 1 month ago

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:

"terminal.integrated.fontFamily": "'FiraCode Nerd Font'",

To:

"terminal.integrated.fontFamily": "'FiraCode Nerd Font','MesloLGS NF', monospace",

Note: This does require you to have installed the 'MesloLGS NF' font provided by powerline10k