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

OhMyPosh themes with arrows render gaps before arrow character #633

Closed
hchokshi opened this issue May 9, 2019 · 21 comments
Closed

OhMyPosh themes with arrows render gaps before arrow character #633

hchokshi opened this issue May 9, 2019 · 21 comments
Assignees
Labels
Area-Fonts Related to the font Area-Rendering Text rendering, emoji, complex glyph & font-fallback issues Issue-Bug It either shouldn't be doing this or needs an investigation. Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.
Milestone

Comments

@hchokshi
Copy link
Member

hchokshi commented May 9, 2019

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

@zadjii-msft zadjii-msft added Area-Fonts Related to the font Area-Rendering Text rendering, emoji, complex glyph & font-fallback issues Issue-Bug It either shouldn't be doing this or needs an investigation. labels May 9, 2019
@zadjii-msft zadjii-msft added this to the Windows Terminal v1.0 milestone May 9, 2019
@zadjii-msft
Copy link
Member

Seems like a thing @miniksa might know about

@ghost ghost added the Needs-Tag-Fix Doesn't match tag requirements label May 17, 2019
@miniksa miniksa added Product-Terminal The new Windows Terminal. and removed Mass-Chaos labels May 17, 2019
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label May 17, 2019
@miniksa miniksa self-assigned this May 21, 2019
@miniksa
Copy link
Member

miniksa commented 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.

@wenbozzz
Copy link

wenbozzz commented 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 900d0c3

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
        }

@efelippe
Copy link

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
        }

@JayXon
Copy link

JayXon commented 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

@VectorWpl
Copy link

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.

@ctolkien
Copy link

ctolkien commented Aug 8, 2019

Same issue for me here:
image

@arnydo
Copy link

arnydo commented Aug 15, 2019

Same issue using Hack NF (Windows Compatible).
image

@DHowett-MSFT
Copy link
Contributor

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
Copy link
Contributor

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

@brantburnett
Copy link

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.

@krokofant
Copy link

krokofant commented 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.

@utybo
Copy link

utybo commented Oct 24, 2019

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

@hchokshi
Copy link
Member Author

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.

@es50678
Copy link

es50678 commented Nov 21, 2019

I was able to get the powerline fonts and symbols working by using the settings from #633 (comment) 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

@fle108
Copy link

fle108 commented Nov 21, 2019

@utybo
Copy link

utybo commented Nov 21, 2019

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

@miniksa
Copy link
Member

miniksa commented Nov 22, 2019

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

@miniksa miniksa closed this as completed Nov 22, 2019
@ghost ghost added the Needs-Tag-Fix Doesn't match tag requirements label Nov 22, 2019
@miniksa miniksa added Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release. and removed Needs-Tag-Fix Doesn't match tag requirements labels Nov 22, 2019
@ofarukcaki
Copy link

ofarukcaki commented 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: JanDeDobbeleer/oh-my-posh#172 (comment)

@MuktadirHassan
Copy link

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.

@zadjii-msft
Copy link
Member

@MuktadirHassan We're actually tracking that particular issue over in #8341

@microsoft microsoft locked and limited conversation to collaborators Feb 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Area-Fonts Related to the font Area-Rendering Text rendering, emoji, complex glyph & font-fallback issues Issue-Bug It either shouldn't be doing this or needs an investigation. Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.
Projects
None yet
Development

No branches or pull requests