Skip to content
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

Rectangles displayed instead of numbers of commits behind #145

Closed
2 tasks done
mgryszko opened this issue Nov 12, 2020 · 41 comments
Closed
2 tasks done

Rectangles displayed instead of numbers of commits behind #145

mgryszko opened this issue Nov 12, 2020 · 41 comments

Comments

@mgryszko
Copy link

Prerequisites

  • I have read and understand the CONTRIBUTING guide
  • 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

@PhilipHaglund
Copy link

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

@JanDeDobbeleer
Copy link
Owner

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

@johannesg
Copy link

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.

@JanDeDobbeleer
Copy link
Owner

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

@PhilipHaglund
Copy link

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

@johannesg
Copy link

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

image

@JanDeDobbeleer
Copy link
Owner

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.

@mgryszko
Copy link
Author

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

@JanDeDobbeleer
Copy link
Owner

JanDeDobbeleer commented Nov 12, 2020

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?

@nwykes
Copy link
Contributor

nwykes commented Nov 12, 2020

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?

@JanDeDobbeleer
Copy link
Owner

JanDeDobbeleer commented Nov 12, 2020

@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.

@cprivitere
Copy link

cprivitere commented Nov 12, 2020

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

@JanDeDobbeleer
Copy link
Owner

JanDeDobbeleer commented Nov 13, 2020

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.

JanDeDobbeleer added a commit that referenced this issue Nov 13, 2020
JanDeDobbeleer added a commit that referenced this issue Nov 13, 2020
@JanDeDobbeleer
Copy link
Owner

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.

@cprivitere
Copy link

That fixed it on my end! Thanks!

@PhilipHaglund
Copy link

Just FYI, my problem was related to microsoft/terminal#3257.
So just installing the fonts system-wide fixed my issue.
https://stackoverflow.com/questions/55264642/how-to-force-win10-to-install-fonts-in-c-windows-fonts

JanDeDobbeleer added a commit that referenced this issue Nov 19, 2020
JanDeDobbeleer added a commit that referenced this issue Nov 19, 2020
JanDeDobbeleer added a commit that referenced this issue Nov 19, 2020
JanDeDobbeleer added a commit that referenced this issue Nov 19, 2020
KyleCrowley pushed a commit to KyleCrowley/oh-my-posh3 that referenced this issue Nov 20, 2020
KyleCrowley pushed a commit to KyleCrowley/oh-my-posh3 that referenced this issue Nov 20, 2020
KyleCrowley pushed a commit to KyleCrowley/oh-my-posh3 that referenced this issue Nov 20, 2020
@KyleKorndoerfer
Copy link

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.

@PhilipHaglund
Copy link

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?

@johannesg
Copy link

johannesg commented Dec 16, 2020

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

@johannesg
Copy link

johannesg commented Dec 16, 2020

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

@KyleKorndoerfer
Copy link

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!

@JanDeDobbeleer
Copy link
Owner

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

@KyleKorndoerfer
Copy link

@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!

@Jarmos-san
Copy link

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!

@hendripermana
Copy link

@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.

what theme you use

@JanDeDobbeleer
Copy link
Owner

@hendripermana that's jandedobbeleer

@nayanex
Copy link

nayanex commented Jul 1, 2021

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

The link is broken

@JanDeDobbeleer
Copy link
Owner

@nayanex see the docs for the latest information.

@deadcoder0904
Copy link

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

@JanDeDobbeleer Where do I put these? I am using Cascadia Code PL & it looks like these icons using Git Branch are the only thing that is not working now. Everything else just works fine.

@JanDeDobbeleer
Copy link
Owner

@deadcoder0904 you can have a look at the hotstick theme for reference.

@deadcoder0904
Copy link

@JanDeDobbeleer no I mean where does that file exist in my system?

@JanDeDobbeleer
Copy link
Owner

@deadcoder0904 you want to export the config and adjust it so you have something that stays changed as oh-my-posh gets updated.

@luisfcevallos
Copy link

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

Thank you, this link works: https://github.com/ryanoasis/nerd-fonts/releases/tag/v2.1.0

@deadcoder0904
Copy link

@luisfcevallos Did you manage to get the icons working? I can't get it to work using lsd. Even Github commits don't have an icon:

lsd

@JanDeDobbeleer
Copy link
Owner

@deadcoder0904 did you have a look at the font guide?

@deadcoder0904
Copy link

@JanDeDobbeleer Yes & I don't know which font to install as there are so many & no one with the name MesloLGM NF. I did install Meslo LG M that has Windows Compatible beside it. Followed countless blogpost the last time but didn't get the icons to work so I gave up eventually.

Ideally, an automated script would've been good to install fonts.

@JanDeDobbeleer
Copy link
Owner

@deadcoder0904 font installs are a machine/terminal thing and not related in any way to oh-my-posh's functionality. The only thing I see is that your terminal is not properly configured, the font could be installed the right way, maybe the name of the font you set is wrong.

@deadcoder0904
Copy link

@JanDeDobbeleer No, having done this countless times on Linux & Mac since 2015 & now Windows, I don't think its wrong as it changes the font perfectly fine.

Here's my config:

"profiles": {
    "defaults": {
      "startingDirectory": "%__CD__%",
      "fontFace": "Cascadia Code PL"
    },
    "list": [
      {
        "commandline": "powershell.exe",
        "cursorColor": "#FFFFFD",
        "cursorShape": "filledBox",
        "experimental.retroTerminalEffect": false,
        "fontFace": "Cascadia Code PL",
        "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
        "hidden": false,
        "name": "Windows PowerShell",
        "startingDirectory": null,
        "suppressApplicationTitle": true,
        "tabTitle": null,
        "useAcrylic": false
      },
}

Changing the profiles doesn't do anything but changing the font in list does change it.

PS: I can't access the nerdfonts.com site since I've probably been blocked by many sites last few months 😂 so apologies if u already have an answer there :)

@deadcoder0904
Copy link

Managed to finally make it work. I guess I did download Powerline Fonts but I didn't download it Patched. I now installed Windows Compatible fonts like https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/CascadiaCode/Regular/complete/Caskaydia%20Cove%20Regular%20Nerd%20Font%20Complete%20Windows%20Compatible.otf & changed the name accordingly.

"list": [
  {
    "commandline": "powershell.exe",
    "cursorColor": "#FFFFFD",
    "cursorShape": "filledBox",
    "experimental.retroTerminalEffect": false,
    "fontFace": "CaskaydiaCove NF",
    "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
    "hidden": false,
    "name": "Windows PowerShell",
    "startingDirectory": null,
    "suppressApplicationTitle": true,
    "tabTitle": null,
    "useAcrylic": false
  },
]

@patrickirvincw
Copy link

I had this problem - the default font was being overridden by List.

Copy link

This issue has been automatically locked since there has not been any recent activity (i.e. last half year) after it was closed. It helps our maintainers focus on the active issues.
If you have found a problem that seems similar, please open a discussion first, complete the body with all the details necessary to reproduce, and mention this issue as reference.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests