Skip to content

Transparent background doesn't become transparent foreground when rendered in reverse video #7014

Open

Description

The new Preview 1.2.2022.0 seems to fix all the VT colors issues I observed before, except one last case:

When the background color is the default (49), it is correctly kept transparent, but if the foreground color is transparent, which is possible when the background is 49 and then the colors are reversed using 7, it is rendered as black instead of transparent.

image
echo -e "\e[31m\u2580\e[7m\u2580\e[m"
echo -e "\e[31m\u2590\e[7m\u25A0\e[27m\u258C\e[m"

In both cases, there should be no black square, the acrylic transparency should show through instead.

Activity

  1. ghost added
    Needs-TriageIt's a new issue that the core contributor team needs to triage at the next triage meeting
    on Jul 22, 2020
  2. ghost added
    Needs-Tag-FixDoesn't match tag requirements
    on Jul 22, 2020
  3. DHowett commented on Jul 22, 2020

    @DHowett
    Member

    Oh yeah, we need to do an inverse alpha mask with the shaped text. It's expensive and something we chose to not to.

  4. PhMajerus commented on Jul 22, 2020

    @PhMajerus
    Author

    Could we get that behavior through an optional flag ?
    I understand your performance goal, but for some ANSI-art effects, the only solution is to use an existing character reversed, such as for the 3-cells square above. Would be nice to be able to turn it on for specific profiles.

  5. DHowett commented on Jul 22, 2020

    @DHowett
    Member

    Meh, I'd be inclined to implement it and not make it configurable -- it's more expensive on the engineering side than it is on the runtime side, I expect. 😄

  6. PhMajerus commented on Jul 22, 2020

    @PhMajerus
    Author

    Dustin L. Howett (@DHowett) 👍 Great, can't wait to see it implemented then 😁

    Especially since you can use it only when you have that specific attributes combination, the current code can be used for faster rendering in every other case, and that combination would definitely look more correct taking advantage of the acrylic effect.

  7. changed the title [-]One last VT color issue in 1.2 - transparent foreground (default background while reversed)[/-] [+]Transparent background doesn't become transparent foreground when rendered in reverse video[/+] on Jul 23, 2020
  8. added
    Area-RenderingText rendering, emoji, complex glyph & font-fallback issues
    Issue-TaskIt's a feature request, but it doesn't really need a major design.
    and removed
    Needs-TriageIt's a new issue that the core contributor team needs to triage at the next triage meeting
    on Jul 23, 2020
  9. ghost removed
    Needs-Tag-FixDoesn't match tag requirements
    on Jul 23, 2020
  10. DHowett commented on Jul 23, 2020

    @DHowett
    Member

    Notes:

    We can't use a geometry mask based on the glyph run, because we want to fill outside of the geometry and not touch inside the geometry[1].

    We may need to use an alpha bitmap (1bpp black and white, converted to an alpha mask) like we did in Islandwood's CGImage and push a layer whose opacity bitmap is this guy.

    [1]: Nevermind, I just saw ID2D1Geometry::CombineWithGeometry; perhaps we can just create a Rectangle geometry, combine EXCLUDE the glyph geometries, and fill that...

  11. 16 remaining items

  12. carpet92 commented on Jul 21, 2022

    @carpet92

    Dustin L. Howett (@DHowett)

    There is info about fix this bug in 1.15.18620 changelog:

    We no longer suppress black blackground or gray foreground for PowerShell (#13352)

    • We have chosen to remove this workaround as newer versions of PowerShell's PSReadline component contain a fix for the issue.
    • This was a compatibility band-aid that was impacting the capabilities of great projects such as Oh My Posh.
    • ❗ If you see unexpected black backgrounds appearing behind text while typing a command in PowerShell, make sure your PSReadline version is up to date. You can update your version of PSReadline by running the command, Update-Module PSReadline.

    I have installed PSReadline 2.2.6 by Install-Module -Name PSReadline -Force for PS 7.2.5. But for me the issue is still reproduces on the latest 1.15.18620.

    Related discussion: JanDeDobbeleer/oh-my-posh#2555

    How to fix the issue as it done in this comment?: #7014 (comment)

  13. zeratax commented on Mar 14, 2023

    @zeratax

    I can still reproduce this as well on 1.17.1023

  14. DHowett commented on Mar 14, 2023

    @DHowett
    Member

    Thanks for the report! That would be because it has not yet been fixed.

  15. FrostKiwi commented on Jul 14, 2023

    @FrostKiwi

    Want to confirm it being broken on my machine as well with ver 1.17.11461.0, as reported in #15491 and #15491
    image

  16. DHowett commented on Jul 14, 2023

    @DHowett
    Member

    Thanks for the report! Yes, this is not machine-specific and requires explicit work in the renderer. We recently put a lot of effort into the new rendering engine, and we think that it should be possible to do this properly.

  17. silkfire commented on Dec 10, 2023

    @silkfire

    What's the status on this? Still present in 1.18.3181.0

    image

  18. zadjii-msft commented on Dec 11, 2023

    @zadjii-msft
    Member

    Yep. We'll make sure to update this thread when there are updates. If someone's interested in trying to fix this themselves, we'd be more than happy to point in the right direction!

  19. Spillium commented on Apr 28, 2026

    @Spillium

    is this still being worked on?? having this issue aswell

  20. j4james commented on Apr 28, 2026

    @j4james
    Collaborator

    FYI, there is an inverse variant of the arrow head glyphs that was added to nerd fonts a couple of years ago, which provides a way to work around this transparency problem. For more info, see #18266 (comment).

  21. pfmoore commented on Apr 28, 2026

    @pfmoore

    which provides a way to work around this transparency problem

    It doesn't work in all situations, and even when it does, it requires extra complication in your setup to use the additional characters. So getting this issue fixed would still be worthwhile.

  22. Spillium commented on Apr 28, 2026

    @Spillium

    which provides a way to work around this transparency problem

    It doesn't work in all situations, and even when it does, it requires extra complication in your setup to use the additional characters. So getting this issue fixed would still be worthwhile.

    yea it doesnt work most of the time. it works fine in powershell but vscode doesnt like it and makes a gap

    Image Image
  23. pfmoore commented on Apr 28, 2026

    @pfmoore

    Does VS Code have a different rendering engine? It might be necessary to raise a separate issue with them - I honestly don't know 🙁 It would be nice if the problem could be solved in a single place, but I don't know if that's the reality here.

  24. lhecker commented on Apr 28, 2026

    @lhecker
    Member

    Indeed, VS Code has its own terminal implementation called xterm.js.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-RenderingText rendering, emoji, complex glyph & font-fallback issuesHelp WantedWe encourage anyone to jump in on these.Issue-TaskIt's a feature request, but it doesn't really need a major design.Product-TerminalThe new Windows Terminal.

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions