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

Missing cursor when experimental text rendering engine is enabled in HDR enabled monitor #12507

Closed
okibcn opened this issue Feb 16, 2022 · 6 comments · Fixed by #12548
Closed
Assignees
Labels
Area-AtlasEngine Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Attention The core contributors need to come back around and look at this ASAP. Needs-Tag-Fix Doesn't match tag requirements Priority-3 A description (P3) 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

@okibcn
Copy link

okibcn commented Feb 16, 2022

Windows Terminal version

1.13.10395.0

Windows build number

10.0.22000

Other Software

Plain vanilla Powershell

Steps to reproduce

  1. Enable Experimental text rendering engine in the advanced submenu of the Powershell profile and save config.
  2. Open a Windows Powershell, Powershell Core, or Command Prompt tab. on an HDR monitor.

Expected Behavior

The cursor should appear and blink.

Actual Behavior

No cursor at all, not even a solid cursor shows up.

Disabling experimental rendering brings back a fully functional blinking cursor.
Moving the Terminal window to a monitor without HDR brings the cursor back.

@okibcn okibcn added the Issue-Bug It either shouldn't be doing this or needs an investigation. label Feb 16, 2022
@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Feb 16, 2022
@zadjii-msft zadjii-msft added Area-AtlasEngine Priority-3 A description (P3) Product-Terminal The new Windows Terminal. labels Feb 17, 2022
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Feb 17, 2022
@zadjii-msft zadjii-msft added this to the 22H1 milestone Feb 17, 2022
@zadjii-msft zadjii-msft removed the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label Feb 17, 2022
@ghost ghost added the Needs-Tag-Fix Doesn't match tag requirements label Feb 17, 2022
@lhecker
Copy link
Member

lhecker commented Feb 18, 2022

If you don't mind, could you post your config file (a minimal one that reproduces your issue is enough), as well as a screenshot of your terminal while you've got input focus?

@lhecker lhecker self-assigned this Feb 18, 2022
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Feb 18, 2022
@lhecker lhecker added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Feb 18, 2022
@ghost ghost added the Needs-Tag-Fix Doesn't match tag requirements label Feb 18, 2022
@zamadatix
Copy link

zamadatix commented Feb 19, 2022

Interestingly if I print-screen the cursor isn't there (which is also what I see during use):

image

and if I unfocus the window and print-screen the cursor isn't there:

image

but if I snipping-tool the window while it is focused the cursor renders:

image

settings.json for reference:

settings.json.txt

@lhecker
Copy link
Member

lhecker commented Feb 20, 2022

Your settings work for me:
image

I wonder how I can reproduce your issue...
It's especially concerning that your cursor shows up if the snipping tool is running, which suggests that something must work in Windows Terminal (otherwise it would be consistently invisible).

@zamadatix
Copy link

I think I bisected the issue, the trigger seems to be HDR. In this video I start the bottom monitor with HDR disabled and the top monitor with HDR enabled. The cursor blinks on the non-HDR monitor and stops blinking when the window is moved to the HDR monitor. If I enable HDR on the bottom monitor the issue occurs on both monitors:

Recording.mp4

Snipping tool takes a non-HDR snapshot of the display buffer during the "freeze-frame" where you can select the portion of the screen to snip. Print-screen on the other hand takes an immediate HDR copy of the output buffer. This explains why the 2 modes behaved differently.

Finally this occurs on a machine with an AMD GPU and a machine with an Nvidia GPU and does not change if software rendering is used. This makes me feel it's not a hardware/driver specific issue rather something with the experimental renderer and HDR directly.

@okibcn
Copy link
Author

okibcn commented Feb 20, 2022

If you don't mind, could you post your config file (a minimal one that reproduces your issue is enough), as well as a screenshot of your terminal while you've got input focus?

I am attaching the settings file and a screenshot of an active session. As you can see the cursor shows up in the capture, but it is not actually rendered on the screen. I am attaching the settings file. It fails both Windows Powershell and Powershell core.
It must be related to the screen resolution and bit depth. When I move the terminal window to another monitor without HDR 4K, it works perfectly both with the new experimental text rendering activated and deactivated. The system uses an Intel GPU, but as far as I read, it was duplicated also with AMD and Nvidia GPUs.

settings.json.txt
Win+S

@ghost ghost added Needs-Attention The core contributors need to come back around and look at this ASAP. Needs-Tag-Fix Doesn't match tag requirements and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something Needs-Tag-Fix Doesn't match tag requirements labels Feb 20, 2022
@okibcn okibcn changed the title Missing cursor when experimental text rendering engine is enabled Missing cursor when experimental text rendering engine is enabled in HDR enabled monitor Feb 20, 2022
@ghost ghost added the Needs-Tag-Fix Doesn't match tag requirements label Feb 20, 2022
@ghost ghost added the In-PR This issue has a related PR label Feb 21, 2022
@ghost ghost closed this as completed in #12548 Feb 22, 2022
@ghost ghost added Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release. and removed In-PR This issue has a related PR labels Feb 22, 2022
ghost pushed a commit that referenced this issue Feb 22, 2022
The previous implementation only inverted the RGB values of the cell,
but failed to account for situations where the `color` is transparent,
which is the case when `backgroundOpaqueMixin` is 0 (for instance if
acrylic backgrounds are enabled). In these situations the alpha
component remained 0 which caused the cursor to be invisible.

For some inexplicable reason this issue is only visible on a HDR display,
even though it should also effect regular ones. God knows why.

With this commit the cursor texture is treated as a mask that inverts the color.
We use branching here, because I couldn't come up with a more clever solution.

## PR Checklist
* [x] Closes #12507
* [x] I work here
* [x] Tests added/passed

## Validation Steps Performed
* Cursor is visible on a HDR display with acrylic background ✅
* TBD performance benchmark for `[branch]` ❌
DHowett pushed a commit that referenced this issue Mar 10, 2022
The previous implementation only inverted the RGB values of the cell,
but failed to account for situations where the `color` is transparent,
which is the case when `backgroundOpaqueMixin` is 0 (for instance if
acrylic backgrounds are enabled). In these situations the alpha
component remained 0 which caused the cursor to be invisible.

For some inexplicable reason this issue is only visible on a HDR display,
even though it should also effect regular ones. God knows why.

With this commit the cursor texture is treated as a mask that inverts the color.
We use branching here, because I couldn't come up with a more clever solution.

## PR Checklist
* [x] Closes #12507
* [x] I work here
* [x] Tests added/passed

## Validation Steps Performed
* Cursor is visible on a HDR display with acrylic background ✅
* TBD performance benchmark for `[branch]` ❌

(cherry picked from commit 9ab4abf)
@ghost
Copy link

ghost commented Mar 25, 2022

🎉This issue was addressed in #12548, which has now been successfully released as Windows Terminal Preview v1.13.1073.:tada:

Handy links:

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-AtlasEngine Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Attention The core contributors need to come back around and look at this ASAP. Needs-Tag-Fix Doesn't match tag requirements Priority-3 A description (P3) 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

Successfully merging a pull request may close this issue.

4 participants