OhMyPosh themes with arrows render gaps before arrow character #903

Closed
opened 2026-01-30 22:09:37 +00:00 by claunia · 21 comments
Owner

Originally created by @hchokshi on GitHub (May 9, 2019).

Originally assigned to: @miniksa on GitHub.

  • Your Windows build number: (Type ver at a Windows Command Prompt)
    Windows 10 18362.30 (Enterprise)
    oh-my-posh 2.0.263 - agnoster theme
    posh-git 0.7.3
    Screenshots taken using Nerd Fonts Inconsolata NF, also tried using FuraCode NF with same results.
    I am using a build from master as of ~11am PDT today.

  • What you're doing and what's happening: (Copy & paste specific commands and their output, or include screen shots)
    Windows Terminal
    image
    Fluent Terminal (expected result)
    image

  • What's wrong / what should be happening instead:
    Arrow characters on powerline should be getting rendered a few pixels to the left, so colour gaps aren't visible (see Fluent Terminal screenshot). Screenshots taken using agnoster theme, but the same happens on other themes utilising those arrows - Paradox and Fish. No issues noticed on themes that don't render this arrow character.
    https://github.com/JanDeDobbeleer/oh-my-posh#themes

Edit: removed ohmyposh disabled screenshot, as that doesn't relate to this issue but to the other one I just opened.

Originally created by @hchokshi on GitHub (May 9, 2019). Originally assigned to: @miniksa on GitHub. * Your Windows build number: (Type `ver` at a Windows Command Prompt) Windows 10 18362.30 (Enterprise) oh-my-posh 2.0.263 - `agnoster` theme posh-git 0.7.3 Screenshots taken using Nerd Fonts `Inconsolata NF`, also tried using `FuraCode NF` with same results. I am using a build from master as of ~11am PDT today. * What you're doing and what's happening: (Copy & paste specific commands and their output, or include screen shots) **Windows Terminal** ![image](https://user-images.githubusercontent.com/10136407/57481005-03527400-7256-11e9-995e-d1f91f5663a9.png) **Fluent Terminal** (expected result) ![image](https://user-images.githubusercontent.com/10136407/57481119-41e82e80-7256-11e9-86bd-fbd21c09298c.png) * What's wrong / what should be happening instead: Arrow characters on powerline should be getting rendered a few pixels to the left, so colour gaps aren't visible (see Fluent Terminal screenshot). Screenshots taken using agnoster theme, but the same happens on other themes utilising those arrows - Paradox and Fish. No issues noticed on themes that don't render this arrow character. https://github.com/JanDeDobbeleer/oh-my-posh#themes Edit: removed ohmyposh disabled screenshot, as that doesn't relate to this issue but to the other one I just opened.
Author
Owner

@zadjii-msft commented on GitHub (May 9, 2019):

Seems like a thing @miniksa might know about

@zadjii-msft commented on GitHub (May 9, 2019): Seems like a thing @miniksa might know about
Author
Owner

@miniksa commented on GitHub (May 21, 2019):

I don't strictly know why this is, but it's probably a renderer thing so I'll self-assign for now.

@miniksa commented on GitHub (May 21, 2019): I don't strictly know why this is, but it's probably a renderer thing so I'll self-assign for now.
Author
Owner

@wenbozzz commented on GitHub (Jun 19, 2019):

Hi,
I got the same issue here using patched nerd font UbuntuMono NF from here
using agnoster theme in zsh

Also tried with different patched nerd fonts like SpaceMono NF, RobotoMono NF and DejaVuSansMono NF, all with the same issue

I'm using the latest master as of right now, with HEAD at 900d0c3cce

image

As you can see first lettter of the command (like c from cd and l from ls) is not rendered
(or rather I guess it's blocked by the charater to the left that looks like this one: ▶)

settings of the ubuntu terminal as below:

{
            "acrylicOpacity" : 0.5,
            "closeOnExit" : true,
            "colorScheme" : "Campbell",
            "commandline" : "wsl.exe -d Ubuntu",
            "cursorColor" : "#FFFFFF",
            "cursorShape" : "bar",
            "fontFace" : "UbuntuMono NF",
            "fontSize" : 10,
            "guid" : "{2c4de342-38b7-51cf-b940-2309a097f518}",
            "historySize" : 9001,
            "icon" : "ms-appx:///ProfileIcons/{9acb9455-ca41-5af7-950f-6bca1bc9722f}.png",
            "name" : "Ubuntu",
            "padding" : "0, 0, 0, 0",
            "startingDirectory" : "%USERPROFILE%",
            "snapOnInput" : true,
            "useAcrylic" : false
        }

Update:
It's seems the character is rendered just fine with the original font (the one that's not nerd font patched)
image

{
            "acrylicOpacity" : 0.5,
            "closeOnExit" : true,
            "colorScheme" : "Campbell",
            "commandline" : "wsl.exe -d Ubuntu",
            "cursorColor" : "#FFFFFF",
            "cursorShape" : "bar",
            "fontFace" : "Roboto Mono for Powerline",
            "fontSize" : 10,
            "guid" : "{2c4de342-38b7-51cf-b940-2309a097f518}",
            "historySize" : 9001,
            "icon" : "ms-appx:///ProfileIcons/{9acb9455-ca41-5af7-950f-6bca1bc9722f}.png",
            "name" : "Ubuntu",
            "padding" : "0, 0, 0, 0",
            "snapOnInput" : true,
            "useAcrylic" : false
        }
@wenbozzz commented on GitHub (Jun 19, 2019): Hi, I got the same issue here using patched nerd font `UbuntuMono NF` from [here](https://github.com/ryanoasis/nerd-fonts/tree/master/patched-fonts/UbuntuMono) using [agnoster](https://github.com/agnoster/agnoster-zsh-theme) theme in zsh Also tried with different patched nerd fonts like `SpaceMono NF`, `RobotoMono NF` and `DejaVuSansMono NF`, all with the same issue I'm using the latest master as of right now, with HEAD at 900d0c3cce39fa191e16b0224fa32c3441f8de24 ![image](https://user-images.githubusercontent.com/1872200/59755896-4e32c300-92bb-11e9-8ae9-d76f3119b2ff.png) As you can see first lettter of the command (like `c` from `cd` and `l` from `ls`) is not rendered (or rather I guess it's blocked by the charater to the left that looks like this one: ▶) settings of the ubuntu terminal as below: ```json { "acrylicOpacity" : 0.5, "closeOnExit" : true, "colorScheme" : "Campbell", "commandline" : "wsl.exe -d Ubuntu", "cursorColor" : "#FFFFFF", "cursorShape" : "bar", "fontFace" : "UbuntuMono NF", "fontSize" : 10, "guid" : "{2c4de342-38b7-51cf-b940-2309a097f518}", "historySize" : 9001, "icon" : "ms-appx:///ProfileIcons/{9acb9455-ca41-5af7-950f-6bca1bc9722f}.png", "name" : "Ubuntu", "padding" : "0, 0, 0, 0", "startingDirectory" : "%USERPROFILE%", "snapOnInput" : true, "useAcrylic" : false } ``` Update: It's seems the character is rendered just fine with the original font (the one that's not nerd font patched) ![image](https://user-images.githubusercontent.com/1872200/59757822-33fae400-92bf-11e9-90e8-b1765a13cd4f.png) ```json { "acrylicOpacity" : 0.5, "closeOnExit" : true, "colorScheme" : "Campbell", "commandline" : "wsl.exe -d Ubuntu", "cursorColor" : "#FFFFFF", "cursorShape" : "bar", "fontFace" : "Roboto Mono for Powerline", "fontSize" : 10, "guid" : "{2c4de342-38b7-51cf-b940-2309a097f518}", "historySize" : 9001, "icon" : "ms-appx:///ProfileIcons/{9acb9455-ca41-5af7-950f-6bca1bc9722f}.png", "name" : "Ubuntu", "padding" : "0, 0, 0, 0", "snapOnInput" : true, "useAcrylic" : false } ```
Author
Owner

@efelippe commented on GitHub (Jun 26, 2019):

Same issue using zsh/oh-my-zsh with powerlevel9k theme
image

I'm using "Sauce Code Powerline" font (patched from nerd-fonts).
Also tried with others fonts from Powerline patched fonts

        {
            "acrylicOpacity" : 0.89999997615814209,
            "closeOnExit" : true,
            "colorScheme" : "Campbell",
            "commandline" : "wsl.exe -d Ubuntu-18.04",
            "cursorColor" : "#FFFFFF",
            "cursorShape" : "filledBox",
            "fontFace" : "SauceCodePro Nerd Font",
            "fontSize" : 12,
            "guid" : "{c6eaf9f4-32a7-5fdc-b5cf-066e8a4b1e40}",
            "historySize" : 9001,
            "icon" : "ms-appx:///ProfileIcons/{9acb9455-ca41-5af7-950f-6bca1bc9722f}.png",
            "name" : "Ubuntu-18.04",
            "padding" : "0, 0, 0, 0",
            "snapOnInput" : true,
            "useAcrylic" : true
        }
@efelippe commented on GitHub (Jun 26, 2019): Same issue using zsh/[oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh) with [powerlevel9k theme](https://github.com/bhilburn/powerlevel9k) ![image](https://user-images.githubusercontent.com/2177647/60197691-3c4ea400-9816-11e9-8923-c1f4100cf7a0.png) I'm using "Sauce Code Powerline" font (patched from [nerd-fonts](https://github.com/ryanoasis/nerd-fonts/tree/master/patched-fonts/SourceCodePro)). Also tried with others fonts from [Powerline patched fonts](https://github.com/powerline/fonts) ``` { "acrylicOpacity" : 0.89999997615814209, "closeOnExit" : true, "colorScheme" : "Campbell", "commandline" : "wsl.exe -d Ubuntu-18.04", "cursorColor" : "#FFFFFF", "cursorShape" : "filledBox", "fontFace" : "SauceCodePro Nerd Font", "fontSize" : 12, "guid" : "{c6eaf9f4-32a7-5fdc-b5cf-066e8a4b1e40}", "historySize" : 9001, "icon" : "ms-appx:///ProfileIcons/{9acb9455-ca41-5af7-950f-6bca1bc9722f}.png", "name" : "Ubuntu-18.04", "padding" : "0, 0, 0, 0", "snapOnInput" : true, "useAcrylic" : true } ```
Author
Owner

@JayXon commented on GitHub (Jul 13, 2019):

I was able to solve this issue by installing the 'Windows Compatible' version of the nerd font, for example Droid Sans Mono Nerd Font Complete Windows Compatible.otf, and then set the fontFace to DroidSansMono NF.

image

@JayXon commented on GitHub (Jul 13, 2019): I was able to solve this issue by installing the 'Windows Compatible' version of the nerd font, for example `Droid Sans Mono Nerd Font Complete Windows Compatible.otf`, and then set the `fontFace` to `DroidSansMono NF`. ![image](https://user-images.githubusercontent.com/1552641/61169467-c420f780-a512-11e9-8a66-bdc5af1dd92d.png)
Author
Owner

@VectorWpl commented on GitHub (Jul 14, 2019):

For me 'Windows Compatible' version of nerd font does not solve the problem, as this basically works for Monospaced fonts and doesn't work for proportionally spaced fonts. Here is example (both 'windows compatible' from nerd fonts):
FiraMono NF (works well)
obraz

FiraCode NF (doesn't work)
obraz

However if after starting app with FiraMono NF in config I would change to FiraCode NF then it will work properly until next restart of app.

@VectorWpl commented on GitHub (Jul 14, 2019): For me 'Windows Compatible' version of nerd font does not solve the problem, as this basically works for Monospaced fonts and doesn't work for proportionally spaced fonts. Here is example (both 'windows compatible' from nerd fonts): `FiraMono NF` (works well) ![obraz](https://user-images.githubusercontent.com/15570764/61181922-d42cfa00-a62c-11e9-888a-066543db1783.png) `FiraCode NF` (doesn't work) ![obraz](https://user-images.githubusercontent.com/15570764/61181930-f0309b80-a62c-11e9-84de-8b2b829e1047.png) However if after starting app with `FiraMono NF` in config I would change to `FiraCode NF` then it will work properly until next restart of app.
Author
Owner

@ctolkien commented on GitHub (Aug 8, 2019):

Same issue for me here:
image

@ctolkien commented on GitHub (Aug 8, 2019): Same issue for me here: ![image](https://user-images.githubusercontent.com/515955/62678101-d6982f00-b9f3-11e9-9392-5bef3d4e4141.png)
Author
Owner

@arnydo commented on GitHub (Aug 15, 2019):

Same issue using Hack NF (Windows Compatible).
image

@arnydo commented on GitHub (Aug 15, 2019): Same issue using Hack NF (Windows Compatible). ![image](https://user-images.githubusercontent.com/11653079/63100470-22435f00-bf45-11e9-8ad1-574631ab844e.png)
Author
Owner

@DHowett-MSFT commented on GitHub (Aug 16, 2019):

Copying my explanation from #635.

The powerline glyphs are in a region of the character table specified as "ambiguous width." Whenever we get one of those, we ask the font how wide the grapheme cluster is. This is required to eventually support things like Devanagari and other N:M glyph->cell mapping scripts. Anyway, the standard NerdFont patcher installs the powerline glyphs as double-width glyphs.

So, Windows Terminal asks how wide the powerline characters are and gets "two cells".

There's a conhost instance backing every tab. That one also (for a long list of legacy compatibility reasons that are better explained in #1739) needs to count cells and widths and characters and stuff. That one is not using the same font, so it gets a different answer: "one cell".

They trivially and immediately disagree on where the cursor is, and where all characters after the mis-identified grapheme cluster are.

@DHowett-MSFT commented on GitHub (Aug 16, 2019): Copying my explanation from #635. > The powerline glyphs are in a region of the character table specified as "ambiguous width." Whenever we get one of those, we ask the _font_ how wide the grapheme cluster is. This is required to eventually support things like Devanagari and other N:M glyph->cell mapping scripts. Anyway, the standard NerdFont patcher installs the powerline glyphs as _double-width glyphs_. > > So, Windows Terminal asks how wide the powerline characters are and gets "two cells". > > There's a conhost instance backing every tab. That one _also_ (for a long list of legacy compatibility reasons that are better explained in #1739) needs to count cells and widths and characters and stuff. That one **is not using the same font**, so it gets a different answer: "one cell". > > They trivially and immediately disagree on where the cursor is, and where _all characters after the mis-identified grapheme cluster_ are.
Author
Owner

@DHowett-MSFT commented on GitHub (Aug 16, 2019):

Additionally, this will be forced into submission by #2066.

@DHowett-MSFT commented on GitHub (Aug 16, 2019): Additionally, this will be forced into submission by #2066.
Author
Owner

@brantburnett commented on GitHub (Oct 1, 2019):

In case this isn't documented anywhere else, I'd like to point out that I am also experiencing the glyph width problem when using Terminal 0.5, Posh-Git, and the new Cascadia Code font.

The problem occurs when I'm in a folder that is a git repo and has a branch synchronization glyph. When I type the third character of a command, the entire line jumps back one space.

@brantburnett commented on GitHub (Oct 1, 2019): In case this isn't documented anywhere else, I'd like to point out that I am also experiencing the glyph width problem when using Terminal 0.5, Posh-Git, and the new Cascadia Code font. The problem occurs when I'm in a folder that is a git repo and has a branch synchronization glyph. When I type the third character of a command, the entire line jumps back one space.
Author
Owner

@krokofant commented on GitHub (Oct 2, 2019):

Me and my colleagues had a bunch of issues with this but it worked for one of us. We're using my LovelyPowershell modules which installs the latest Hack NF fonts from the nerd-fonts master.

Turns out those of us that had issues had older versions of the font. The latest on nerd-fonts master makes this issue go away. We're using the Complete Mono Windows Compatible versions.

🎉🎉🎉

Edit: If you try the fonts from the master branch then make sure that the old ones are actually uninstalled.

@krokofant commented on GitHub (Oct 2, 2019): Me and my colleagues had a bunch of issues with this but it worked for one of us. We're using my [LovelyPowershell](https://github.com/krokofant/lovely-powershell) modules which installs the latest Hack NF fonts from the nerd-fonts master. Turns out those of us that had issues had older versions of the font. The latest on [nerd-fonts master](https://github.com/ryanoasis/nerd-fonts/tree/74ade3305ef159734043580e28afea5d8b495e68/patched-fonts/Hack) makes this issue go away. We're using the _Complete Mono Windows Compatible_ versions. 🎉🎉🎉 Edit: If you try the fonts from the master branch then make sure that the old ones are actually uninstalled.
Author
Owner

@utybo commented on GitHub (Oct 24, 2019):

Isn't this fixed by the latest release? The arrows seem to work fine for me now

@utybo commented on GitHub (Oct 24, 2019): Isn't this fixed by the latest release? The arrows seem to work fine for me now
Author
Owner

@hchokshi commented on GitHub (Oct 24, 2019):

Isn't this fixed by the latest release? The arrows seem to work fine for me now

I am also seeing this as fixed in yesterday's Github release.

@hchokshi commented on GitHub (Oct 24, 2019): > Isn't this fixed by the latest release? The arrows seem to work fine for me now I am also seeing this as fixed in yesterday's Github release.
Author
Owner

@es50678 commented on GitHub (Nov 21, 2019):

I was able to get the powerline fonts and symbols working by using the settings from https://github.com/microsoft/terminal/issues/633#issuecomment-505954755 above. However, the colors do not match what I expect them to. I also have the wsltty installed which outputs the correct colors. Has anyone been able to get windows terminal to output the right colors? Or know which setting I should change?

Capture

@es50678 commented on GitHub (Nov 21, 2019): I was able to get the powerline fonts and symbols working by using the settings from https://github.com/microsoft/terminal/issues/633#issuecomment-505954755 above. However, the colors do not match what I expect them to. I also have the [wsltty](https://github.com/mintty/wsltty) installed which outputs the correct colors. Has anyone been able to get windows terminal to output the right colors? Or know which setting I should change? ![Capture](https://user-images.githubusercontent.com/17823824/69290992-bde10d00-0bcf-11ea-9e8e-2aa98b98df9e.PNG)
Author
Owner

@fle108 commented on GitHub (Nov 21, 2019):

use colortool :
https://github.com/Microsoft/Terminal/tree/master/src/tools/ColorTool

@fle108 commented on GitHub (Nov 21, 2019): use colortool : [https://github.com/Microsoft/Terminal/tree/master/src/tools/ColorTool](url)
Author
Owner

@utybo commented on GitHub (Nov 21, 2019):

@es50678 you can change the color scheme used by the terminal in your settings, check here for details

@utybo commented on GitHub (Nov 21, 2019): @es50678 you can change the color scheme used by the terminal in your settings, check [here](https://github.com/microsoft/terminal/blob/master/doc/user-docs/UsingJsonSettings.md) for details
Author
Owner

@miniksa commented on GitHub (Nov 22, 2019):

Confirmed with @DHowett-MSFT that this should be resolved in the upcoming release thanks to #2066. Resolving.

@miniksa commented on GitHub (Nov 22, 2019): Confirmed with @DHowett-MSFT that this should be resolved in the upcoming release thanks to #2066. Resolving.
Author
Owner

@ofarukcaki commented on GitHub (Dec 31, 2021):

I have the same problem, it was working fine yesterday and I changed nothing. Opening the terminal for the first time looks like that, and after that, it just works normally. Does anyone know a solution? I tried all suggested fixes above and yet none worked

image

Edit: Found out it is a windows terminal problem, a temporary workaround worked: https://github.com/JanDeDobbeleer/oh-my-posh/issues/172#issuecomment-912132691

@ofarukcaki commented on GitHub (Dec 31, 2021): I have the same problem, it was working fine yesterday and I changed nothing. Opening the terminal for the first time looks like that, and after that, it just works normally. Does anyone know a solution? I tried all suggested fixes above and yet none worked ![image](https://user-images.githubusercontent.com/24359008/147831497-e9b20c84-29d4-4df3-9086-d972b3baea0f.png) Edit: Found out it is a windows terminal problem, a temporary workaround worked: https://github.com/JanDeDobbeleer/oh-my-posh/issues/172#issuecomment-912132691
Author
Owner

@MuktadirHassan commented on GitHub (Feb 18, 2022):

Still persists on the latest version of terminal.
Windows Terminal
Version: 1.11.3471.0
Windows 11 Version 21H2 Build 22000.527
image

Workaround is to add

clear

at the end in .bashrc if you are using bash.

@MuktadirHassan commented on GitHub (Feb 18, 2022): Still persists on the latest version of terminal. Windows Terminal Version: 1.11.3471.0 Windows 11 Version 21H2 Build 22000.527 ![image](https://user-images.githubusercontent.com/46109431/154683136-c8a5ab01-e8c0-4b4f-87cc-7fa0be698020.png) Workaround is to add > clear at the end in .bashrc if you are using bash.
Author
Owner

@zadjii-msft commented on GitHub (Feb 18, 2022):

@MuktadirHassan We're actually tracking that particular issue over in https://github.com/microsoft/terminal/issues/8341

@zadjii-msft commented on GitHub (Feb 18, 2022): @MuktadirHassan We're actually tracking that particular issue over in https://github.com/microsoft/terminal/issues/8341
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#903