Strange color issue after adding Windows UI dependence #20642

Closed
opened 2026-01-31 07:19:54 +00:00 by claunia · 9 comments
Owner

Originally created by @xarthurx on GitHub (Oct 10, 2023).

Windows Terminal version

1.18.2681.0

Windows build number

10.0.19045.0

Other Software

Powershell 7.3.8
oh-my-posh

Steps to reproduce

Configuring Powershell prompt with a segment:

      "segments": [
        {
          "type": "os",
          "style": "diamond",
          "background": "#20649c",
          "foreground": "#fff",
          "leading_diamond": "\ue0c7",
          "trailing_diamond": "\ue0c6",
          "properties": {
            "style": "folder"
          }
        },

Expected Behavior

The cmd prompt is shown correctly -- without those white reverted color.

Actual Behavior

I got the prompt like img below:
image

The white dots in the prompt is something emerged after I update Windows Terminal with winget, and noticed there is a new dependence called something like Windows XML UI (sorry that I cannot find the package...)

FYI, the key factor is leading_diamond keyword.

Perhaps an issue in calculating the background color?

Originally created by @xarthurx on GitHub (Oct 10, 2023). ### Windows Terminal version 1.18.2681.0 ### Windows build number 10.0.19045.0 ### Other Software Powershell 7.3.8 oh-my-posh ### Steps to reproduce Configuring Powershell prompt with a segment: ```pwsh "segments": [ { "type": "os", "style": "diamond", "background": "#20649c", "foreground": "#fff", "leading_diamond": "\ue0c7", "trailing_diamond": "\ue0c6", "properties": { "style": "folder" } }, ``` ### Expected Behavior The cmd prompt is shown correctly -- without those white reverted color. ### Actual Behavior I got the prompt like img below: ![image](https://github.com/microsoft/terminal/assets/1921878/f72c14ea-e34f-41bc-b77e-a6dc9cf7a8c9) The white dots in the prompt is something emerged after I update Windows Terminal with `winget`, and noticed there is a new dependence called something like `Windows XML UI` (sorry that I cannot find the package...) FYI, the key factor is `leading_diamond` keyword. Perhaps an issue in calculating the background color?
claunia added the Needs-TriageIssue-BugNeeds-Attention labels 2026-01-31 07:19:54 +00:00
Author
Owner

@DHowett commented on GitHub (Oct 10, 2023):

Hey there! Terminal has always used WinUI ("XAML", "WinUI", "Microsoft.UI.XAML"). It's just that WinGet didn't support installing it.

Can you check out this setting?

Settings -> Defaults -> Appearance -> Automatically Adjust the Appearance of ...

image

This setting, which is somewhat new, makes it so that low-contrast text gets brightened/darkened so that it is visible.

@DHowett commented on GitHub (Oct 10, 2023): Hey there! Terminal has always used WinUI ("XAML", "WinUI", "Microsoft.UI.XAML"). It's just that WinGet didn't support installing it. Can you check out this setting? Settings -> Defaults -> Appearance -> Automatically Adjust the Appearance of ... <img width="764" alt="image" src="https://github.com/microsoft/terminal/assets/189190/2db6ff15-6284-455d-8a87-1335d2d229b9"> This setting, which is somewhat new, makes it so that low-contrast text gets brightened/darkened so that it is visible.
Author
Owner

@xarthurx commented on GitHub (Oct 10, 2023):

Hey there! Terminal has always used WinUI ("XAML", "WinUI", "Microsoft.UI.XAML"). It's just that WinGet didn't support installing it.

Can you check out this setting?

Settings -> Defaults -> Appearance -> Automatically Adjust the Appearance of ...

image This setting, which is somewhat new, makes it so that low-contrast text gets brightened/darkened so that it is visible.

It was "Never".
If I change it to "always", I got this:
image

Slightly better, but still have the "white" color at the beginning part.

@xarthurx commented on GitHub (Oct 10, 2023): > Hey there! Terminal has always used WinUI ("XAML", "WinUI", "Microsoft.UI.XAML"). It's just that WinGet didn't support installing it. > > Can you check out this setting? > > Settings -> Defaults -> Appearance -> Automatically Adjust the Appearance of ... > > <img alt="image" width="764" src="https://user-images.githubusercontent.com/189190/274015411-2db6ff15-6284-455d-8a87-1335d2d229b9.png"> > This setting, which is somewhat new, makes it so that low-contrast text gets brightened/darkened so that it is visible. It was "Never". If I change it to "always", I got this: ![image](https://github.com/microsoft/terminal/assets/1921878/0c185b0a-9335-43b2-a5a9-e4080f0165d8) Slightly better, but still have the "white" color at the beginning part.
Author
Owner

@DHowett commented on GitHub (Oct 10, 2023):

Oh, thanks! I think I understand what's happening here.

Are you using the "modern rendering engine (AtlasEngine)"? Settings->Rendering.

If so: I bet that this glyph is extending outside of its box, and picking up the color of the Windows logo next to it. This is a very difficult thing for us to get "right" because consensus is split on whether "overhanging" glyphs (those that go outside their boxes) should get the color of the cell they came from or the cell they are currently on top of.

We chose the give them the color of the cell they are on top of, because that is the only way to make ligatures work properly:

image (This is one glyph, but it spans four cells!)

At the end of the day, this looks a bit like a font authoring issue. The extended powerline characters are too big for their boxes.

Using a different font, but with roughly the same settings, I get this:

image

The bounding box for the fading boxes in my character is the size of this green rectangle (well, it would be if I didn't get that black part in the bottom...)-

image

@DHowett commented on GitHub (Oct 10, 2023): Oh, thanks! I think I understand what's happening here. Are you using the "modern rendering engine (AtlasEngine)"? Settings->Rendering. If so: I bet that this glyph is extending outside of its box, and picking up the color of the Windows logo next to it. This is a very difficult thing for us to get "right" because consensus is split on whether "overhanging" glyphs (those that go outside their boxes) should get the color of the cell they came from or the cell they are currently on top of. We chose the give them the color of the cell they are on top of, because that is the only way to make ligatures work properly: <img width="105" alt="image" src="https://github.com/microsoft/terminal/assets/189190/644b693a-20c9-40d8-aeb1-6d6dadcc5e15"> (This is one glyph, but it spans four cells!) At the end of the day, this looks a bit like a font authoring issue. The extended powerline characters are too big for their boxes. Using a different font, but with roughly the same settings, I get this: <img width="131" alt="image" src="https://github.com/microsoft/terminal/assets/189190/e1ee1ee2-7499-4d0a-b7ea-c78bbb5f8607"> The bounding box for the fading boxes in my character is the size of this green rectangle (well, it would be if I didn't get that black part in the bottom...)- ![image](https://github.com/microsoft/terminal/assets/189190/7993dee4-3ac4-49f2-988a-89fc8417b289)
Author
Owner

@DHowett commented on GitHub (Oct 10, 2023):

In other words...

If you do this (in PowerShell), I bet you'll see something different from me.

"`u{e0c7}X`u{e0c6}"

I see this:

image

Everything is nicely contained because the glyphs don't extend outside their boxes.

@DHowett commented on GitHub (Oct 10, 2023): In other words... If you do this (in PowerShell), I bet you'll see something different from me. ``` "`u{e0c7}X`u{e0c6}" ``` I see this: <img width="264" alt="image" src="https://github.com/microsoft/terminal/assets/189190/60cadc3a-5d54-46ac-bd30-1d0415632025"> Everything is nicely contained because the glyphs don't extend outside their boxes.
Author
Owner

@xarthurx commented on GitHub (Oct 10, 2023):

image
I got this.

I see, but even if I disabled the "AtlasEngine", it still looks wired:
image

These all happens after a recent update of Windows Terminal... Before, everything is fine.

Is there a way to fix the glyph issue? Or I need to use a different char?
The font I use is a patched version of Cascadia.
image

@xarthurx commented on GitHub (Oct 10, 2023): ![image](https://github.com/microsoft/terminal/assets/1921878/0847553c-7123-4525-bdf9-ae4bb44a33c5) I got this. I see, but even if I disabled the "AtlasEngine", it still looks wired: ![image](https://github.com/microsoft/terminal/assets/1921878/00a40ffc-0c18-4799-8786-245a8890c5e3) These all happens after a recent update of Windows Terminal... Before, everything is fine. Is there a way to fix the glyph issue? Or I need to use a different char? The font I use is a patched version of Cascadia. ![image](https://github.com/microsoft/terminal/assets/1921878/5ce12e44-d47e-471e-b257-27282ca35699)
Author
Owner

@DHowett commented on GitHub (Oct 10, 2023):

You may want to look into Delugia Code. I know that they run their patcher a little differently from the Caskaydia one.

I don't totally understand why they overwrite our Powerline glyphs, though! Cascadia includes metrics-appropriate versions of all of these shapes... just not the rest of the Nerd Font glyphs ☹️

@DHowett commented on GitHub (Oct 10, 2023): You may want to look into Delugia Code. I know that they run their patcher a little differently from the Caskaydia one. I don't totally understand why they overwrite our Powerline glyphs, though! Cascadia includes metrics-appropriate versions of all of these shapes... just not the rest of the Nerd Font glyphs ☹️
Author
Owner

@xarthurx commented on GitHub (Oct 10, 2023):

You may want to look into Delugia Code. I know that they run their patcher a little differently from the Caskaydia one.

I don't totally understand why they overwrite our Powerline glyphs, though! Cascadia includes metrics-appropriate versions of all of these shapes... just not the rest of the Nerd Font glyphs ☹️

OK. Thanks for the detailed explanation above. I'll try to look into different solutions.

@xarthurx commented on GitHub (Oct 10, 2023): > You may want to look into Delugia Code. I know that they run their patcher a little differently from the Caskaydia one. > > I don't totally understand why they overwrite our Powerline glyphs, though! Cascadia includes metrics-appropriate versions of all of these shapes... just not the rest of the Nerd Font glyphs ☹️ OK. Thanks for the detailed explanation above. I'll try to look into different solutions.
Author
Owner

@xarthurx commented on GitHub (Oct 10, 2023):

I found a solution...
There are two types of Cascadia Nerd Font, the mono version actually works fine (with automatic lightness adjustment OFF).
image

@xarthurx commented on GitHub (Oct 10, 2023): I found a solution... There are two types of Cascadia Nerd Font, the `mono` version actually works fine (with automatic lightness adjustment OFF). ![image](https://github.com/microsoft/terminal/assets/1921878/3e5e1da2-d16f-47c7-80a8-f2a1ce00c2f8)
Author
Owner

@DHowett commented on GitHub (Oct 11, 2023):

Fascinating! Thank you. I'll note that down for future reports, and see if we can get it into our docs.

@DHowett commented on GitHub (Oct 11, 2023): _Fascinating!_ Thank you. I'll note that down for future reports, and see if we can get it into our docs.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#20642