Oh-my-posh3: Rectangles displayed instead of numbers of commits behind

Created on 12 Nov 2020  路  24Comments  路  Source: JanDeDobbeleer/oh-my-posh3

Prerequisites

  • [x] I have read and understand the CONTRIBUTING guide
  • [x] I looked for duplicate issues before submitting this one

Description

Some non-Powerline symbols are not rendered correctly. Used font: Cascadia Mono PL.

Compare oh-my-posh 2.0.487 on Windows PowerShell 5.1:

image

with the oh-my-post 3.33.0-beta on PowerShell Core 7.0.3:

image

Environment

  • Oh my Posh version: 3.33.0-beta
  • Theme: fish
  • Operating System: Windows 1909 build 18363.1139
  • Shell: PowerShell Core 7.0.3
  • Terminal: Windows Terminal 1.3.2651.0

Steps to Reproduce

Set-PoshPrompt -Theme fish

Expected behavior: look&feel of oh-my-posh 2

Actual behavior: rectangles displayed instead of commits behind

All 24 comments

Can confirm I have the same issue.

Environment

  • Oh my Posh version: 3.33.0-beta
  • Theme: powerlevel10k_classic
  • Operating System: Windows 20H2 (19042.630)
  • Shell: PowerShell 7.1
  • Terminal: Windows Terminal 1.4.3141.0

You need to set a Nerd Font in your terminal. See here for more context.

It does not seem to work for all Nerd Fonts. I tried Cascayda Cove (NF version of Cascadia Code, and my preferred font), Fira Code and Meslo. Out of those 3, only Meslo worked for me.

They should be universally equal when it comes to those things but I'll double check!

Found out that I've installed the Mono-version and after the latest version of Oh my Posh it broke.
Just installing the the Non-Mono version made everything work for me.
image

Terminal - settings.json
image

image

Unfortunately that didn't work for me. I uninstalled all CaskaydiaCove fonts and reinstalled the windows compatible version. I still get no symbols.

image

That's really weird. Are you sure the font that's set is correct? Because even the powerline symbol is broken, that one I haven't seen before.

I installed the same font as @PhilipHaglund is using (BTW, very nice font) and I'm still having the same issue.

Oh my Posh has no way to influence the font and uses the codes in the official Nerd Font cheat sheet. The character encoding of Powershell shouldn't influence this either (at least not with that output), although, as a test, does setting that to UTF8 change anything?

I installed the same font as @PhilipHaglund is using (BTW, very nice font) and I'm still having the same issue.

You've configured your Terminal to use that font?

@mgryszko this is that font in my terminal:
afbeelding
I would really check the settings because 9/10 something is off in your terminal configuration.

Can confirm, using the microsoft provided PL version of Cascadia Code (it's bundled in their overall Cascadia Code release) https://github.com/microsoft/cascadia-code and version 3 of oh-my-posh does result in boxes for the git commit version numbers. Version 2 didn't do this.

There is literally no other config to check. This is stock Windows Terminal (preview version in case that matters) with a from scratch settings.json with only the font choice specified. Even a fresh install of Powershell 7.1, but it happnes on 7.0 too. Did this on two separate machines even.

Using oh-my-posh3 installed via Install-Module oh-my-posh -Scope CurrentUser -AllowPrerelease

What sort of useful info can we get to help debug this? Is there some possibility that the symbol being called in 3 is different than 2 and the font some people use doesn't have one of them?

Here's it not working in 3:
image

Here's it working in 2, the only change is oh-my-posh:
image

OK, so, there's nothing to debug in that case. The only thing needed is to create a config that uses the icons available in Cascadia Code. This is not a bug, it's actually by design as I use Nerd Fonts to have a wider range of icons. When using the nerd font version of Cascadia Code, I do get all correct symbols in my terminal, which is as expected.

You can dump the current config with Write-PoshTheme, store it in a file, adjust the icons and use that file when setting the prompt using Set-PoshTheme.

For these icons specifically, using Cascadia Code PL, these are the git icons which needs adjusting:

"branch_identical_icon": "\u2261 ",
"branch_ahead_icon": "\u2191 ",
"branch_behind_icon": "\u2193 ",
"branch_gone_icon": "\u2262 "

There will be other icons which don't map but hopefully this provides the information you were looking for.

EDIT: looking at this I tried these glyphs in Nerd Font and they also work there. While this won't fix all icons (some are simply not available in Cascadia Code PL), I'll create a small adjustment that maps as many of these for the Git segment.

I'm going to close this as I can't reproduce this with any NF set correctly and did my best to support Cascadia Code PL as much as I could. Let me know if there's anything else I can do.

That fixed it on my end! Thanks!

I just updated to oh-my-posh 3.53.1 beta and am having the same issues within Windows Terminal. I have installed different NF fonts using the 'install for all users' option but only Meslo seems to work (which is not my preferred font). @PhilipHaglund what worked for you (including any changes to terminal, encoding, etc.)? I had everything working great in v2 and really regretting moving to v3 at the moment.

I just updated to oh-my-posh 3.53.1 beta and am having the same issues within Windows Terminal. I have installed different NF fonts using the 'install for all users' option but only Meslo seems to work (which is not my preferred font). @PhilipHaglund what worked for you (including any changes to terminal, encoding, etc.)? I had everything working great in v2 and really regretting moving to v3 at the moment.

I just installed "CaskaydiaCove NF" as Administrator to "All Users".
Do you still have the same issue with boxes? Are you using the latest Terminal?

I just updated to oh-my-posh 3.53.1 beta and am having the same issues within Windows Terminal. I have installed different NF fonts using the 'install for all users' option but only Meslo seems to work (which is not my preferred font). @PhilipHaglund what worked for you (including any changes to terminal, encoding, etc.)? I had everything working great in v2 and really regretting moving to v3 at the moment.

I also have the same problem still. Meslo works always, but Cascaidya does not work, whether it's installed for all users or not.

Version: 3.53.1
Theme: Paradox
Terminal version: 1.4.3243.0

FontFace: CascadyaCode NF (Installed for all users)
image

FontFace: MesloLGM NF (Installed for current user)
image

FontFace: Cascadia Mono PL (Installed for current user)
image

Oh s**t. I mispelled the font name, it should of course be "CaskaydiaCove NF". Now it works. Ignore my previous comment :-)

I must have made the same mistake as it is working for me now as well. Only issue remaining for me is getting GIT to change colors on status as it did in v2!

@KyleKorndoerfer that's a feature, check the git segment docs, it should all be in there!

@JanDeDobbeleer I got it after poking at it for a bit. What confused me initially was the reference to color for the various git states so I was using the angle bracket syntax instead of straight color numbers. All good now, thanks!

It appears Windows users are a bit confused on how to get the glyphs working. The documentation helps a lot to install the OMP v3. So ensure you've it installed first, then follow these steps to get the fonts working.

  • Download your preferred font family & extract the zipped file.
  • Right click on the specific font face & "Install for all users". Check the GIF for clarification where I'm using the Meslo LG L font face.

fhZausSWWU

  • Configure Windows Terminal (if you're not using it, you should) to use the specific font face. Meslo LG L in my case.
    "profiles": {
        "defaults": {
            "fontFace": "MesloLGL Nerd Font",

Enjoy!

Was this page helpful?
0 / 5 - 0 ratings