Skip to content

Popup windows can cause weird color updates in conhost #6247

Closed

Description

Environment

Windows build number: Version 10.0.18362.720

Steps to reproduce

  1. Open a conhost cmd shell.
  2. Open the Properties dialog and make sure Terminal Colors are unchecked, and the Screen Background is set to black (index 0). Restart the shell if you had to change the colors.
  3. Do something in the shell to fill the screen with text, e.g. dir /?.
  4. Press F7 to popup the command history window.
  5. While the popup is still visible, open the Properties dialog again, and change the Screen Background to blue (index 1).
  6. After saving the properties, press Esc to close the history popup.

Expected behavior

The text beneath the popup should be restored with its original color, or otherwise the entire screen background should have changed to blue.

Actual behavior

Most of the screen remains black, but the lines beneath the popup have changed to blue.

image

What's happening is that the Popup class is trying to be clever, and update the area beneath it to match the changes to the default colors, assuming the rest of the screen is also going to be changed (which is what used to happen in the v1 console). But since that's no longer the case, it's actually just breaking things.

You could argue that we should be fixing the fact that the default screen colors don't update. But the best way to do that (at least in my opinion), is the solution I proposed for #5952. With that fix in place, the default colors just update automatically, so there should be no need for the popup window to perform any additional color mapping.

And in addition to updating the default colors, it also tries to update what it thinks are popup colors (or their inverse). So any text that just happens to match those colors can find itself being updated as well. I assume this is to handle the case of a popup on top of another popup, but the popup window itself doesn't update when you change those colors, so I can't see why it would need to update another popup beneath it.

In short, I would like to propose we get rid of this code altogether, unless someone knows of a genuine need for it. Right now it seems to be doing more harm than good.

Activity

  1. ghost added
    Needs-TriageIt's a new issue that the core contributor team needs to triage at the next triage meeting
    on May 28, 2020
  2. ghost added
    Needs-Tag-FixDoesn't match tag requirements
    on May 28, 2020
  3. added
    Area-OutputRelated to output processing (inserting text into buffer, retrieving buffer text, etc.)
    Issue-BugIt either shouldn't be doing this or needs an investigation.
    Product-ConhostFor issues in the Console codebase
    on Jun 1, 2020
  4. ghost removed
    Needs-Tag-FixDoesn't match tag requirements
    on Jun 1, 2020
  5. removed
    Needs-TriageIt's a new issue that the core contributor team needs to triage at the next triage meeting
    on Jun 1, 2020
  6. zadjii-msft commented on Jun 1, 2020

    @zadjii-msft
    Member

    Yep that looks like a real bug to me. Thanks for the investigation so far!

  7. ghost added
    In-PRThis issue has a related PR
    on Jun 4, 2020
  8. ghost closed this as completedin #6358on Jun 8, 2020
  9. ghost added a commit that references this issue on Jun 8, 2020
  10. ghost removed
    In-PRThis issue has a related PR
    on Jun 8, 2020
  11. ghost added
    Resolution-Fix-CommittedFix is checked in, but it might be 3-4 weeks until a release.
    on Jun 8, 2020
  12. added a commit that references this issue on Sep 5, 2020
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-OutputRelated to output processing (inserting text into buffer, retrieving buffer text, etc.)Issue-BugIt either shouldn't be doing this or needs an investigation.Priority-3A description (P3)Product-ConhostFor issues in the Console codebaseResolution-Fix-CommittedFix is checked in, but it might be 3-4 weeks until a release.

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions