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

CursorColor changed on its own #193

Closed
mqudsi opened this issue May 26, 2018 · 14 comments
Closed

CursorColor changed on its own #193

mqudsi opened this issue May 26, 2018 · 14 comments
Assignees
Labels
Product-Conhost For issues in the Console codebase Resolution-Fix-Available It's available in an Insiders build or a release Work-Item It's being tracked by an actual work item internally. (to be removed soon)
Milestone

Comments

@mqudsi
Copy link

mqudsi commented May 26, 2018

Running 17672, I suddenly found (with two terminal windows open) that one terminal window's cursor had turned black instead of gray. From that point onwards, all my terminals (Windows or WSL) have had a black cursor (even after DECSCUSR calls).

I imagine this might be related to the newly landed support for setting cursor shape, but I'm unable to get this color change to revert.

Deleting CursorColor in the Console registry key took care of the issue, but I'm not sure how it could have come to be in the first place. This option isn't exposed userland, is it? Black is DWORD 0, so it could be that the value was simply created with a default integer for its content, but again, not sure how that happened.

@zadjii-msft
Copy link
Member

Oh no, this bug actually made it out to insiders 😢

I noticed this a few builds ago internally, I'm not totally sure what it is, but I believe it's a bad manifesting issue, but I already have a bug open to investigate more.

You're correct, deleting the CursorColor key will revert it to the old behavior. Alternatively, you could set it to another hex value to actually give the cursor a specific color.

What's happening with this bug I believe is that we're zeroing out the cursor color, causing it to render as black on black.

@zadjii-msft zadjii-msft added Work-Item It's being tracked by an actual work item internally. (to be removed soon) Product-Conhost For issues in the Console codebase labels May 26, 2018
@zadjii-msft zadjii-msft self-assigned this May 26, 2018
@zadjii-msft zadjii-msft added this to the RS5 milestone May 26, 2018
@mqudsi
Copy link
Author

mqudsi commented May 26, 2018

Thanks for the speedy reply! Would pre-creating the registry field with a non-zero value on build upgrade perhaps avoid the problem?

@zadjii-msft
Copy link
Member

That's almost certainly going to be the fix, yea.

To get more specific: conhost treats 0xffffffff as an invalid color. When it sees that value for the cursor color, it knows to instead use the legacy "invert color" behavior of the cursor.
I think I forgot to add to the manifests that the defaults for that reg key (and shortcut property) should be 0xffffffff, so those values are left un-filled.

At about the same time we started type-checking the values in the registry for settings, and zeroing them appropriately.

I'm not sitting in front of the code right now, but my guess is that we're finding no value for the cursor color, and instead of defaulting to 0xffffffff, we're defaulting to 0x00000000 - black.

Fortunately, because these settings get re-applied on build-to-build upgrades, as soon as I fix the manifest it should fix your settings :)

@zadjii-msft
Copy link
Member

Checked in the fix earlier today.

WE really should create a batch script that people can use to set their cursor colors just in case they run into this, or if they want to change the colors of their cursor just for the heck of it. I just haven't had the cycles to put something together.

@zadjii-msft zadjii-msft added the Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release. label Jun 7, 2018
@WSLUser
Copy link
Contributor

WSLUser commented Jul 10, 2018

Fix is out in Insider build 17711. On the main Windows Build blog too vice WSL/Console Release Notes (which I found odd).

We fixed an issue that could result in the console forgetting the cursor color on upgrade and it getting set to 0x000000 (black). The fix will prevent future users from hitting this issue, but if you’ve already been impacted by this bug, you’ll need to manually fix the setting in the registry. To do this, open regedit.exe and delete the ‘CursorColor’ entry in ‘Computer\HKEY_CURRENT_USER\Console’ and any sub-keys, and re-launch your console window.

@bbulkow
Copy link

bbulkow commented Aug 10, 2018

As per https://github.com/Microsoft/console/issues/232, this has NOT been fixed even as of 17713, and more fixes are inbound.

@bbulkow
Copy link

bbulkow commented Aug 11, 2018

Is there a workaround that works on 17713? Deleting the registry key seems not to, changing the registry key seems not do (tried 0x00202020), or if I go to Fast Insiders, maybe I pick up enough fixes?

Ironically, I went to Insiders just to get the Copy/Paste console fix, which is best feature ever 😁

@zadjii-msft
Copy link
Member

Yea, it seems that the black cursor color could corrupt your shortcut, which you'd be unable to fix at all. So please be patient while more fixes bubble out :)

@bbulkow
Copy link

bbulkow commented Aug 13, 2018

What worked for me was setting the cursor color to 60606060, and the cursor type to 1 from zero.

Happy to be patient, sort of, not having a cursor was killing me, was about to roll back, the workaround saved running Insider....

@ioweb-gr
Copy link

Hi, what's the full path for the registry key? I've been struggling with this as well

@zadjii-msft
Copy link
Member

@ioweb-gr That depends on how you're launching the console. I'd take a look at HKCU\Console and all of it's sub-keys. If you remove all the CursorColor settings from that tree, then the setting is being stored in the shortcut (.lnk), not the registry.

The persistence (and loading) of the cursor color was disabled for the 1809 release, so whenever you get upgraded to the October Update, that should fix it.

@zadjii-msft zadjii-msft added Resolution-Fix-Available It's available in an Insiders build or a release and removed Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release. labels Oct 22, 2018
@ioweb-gr
Copy link

thanks @zadjii-msft I wanted to try the solution here in case it helped because my problem seemed similar however my problem doesn't seem to be the same as this one as the cursor color settings didn't change anything at all. My cursor seems to disappear when moving it with arrow keys or while typing. If I leave it there it starts blinking again after a while and I see it but it makes it really hard to type.

The shortcut I'm using is the default shortcut from the ubuntu store app. I'm running currently build 18252.1000.

@zadjii-msft
Copy link
Member

@ioweb-gr that's #269, unrelated to the cursor color issue.

@ioweb-gr
Copy link

Ah great. I couldn't find it before. I'll monitor that thread then

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Product-Conhost For issues in the Console codebase Resolution-Fix-Available It's available in an Insiders build or a release Work-Item It's being tracked by an actual work item internally. (to be removed soon)
Projects
None yet
Development

No branches or pull requests

5 participants