microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.78k stars 29.48k forks source link

mouse text selection cursor turned white on light themes #204103

Open ruffzzzy opened 9 months ago

ruffzzzy commented 9 months ago

Type: Bug

I use windows with dark theme and vs code with light theme, and mouse text selection cursor turned white so i barely can see it. Tried different light themes - all them have the issue i mentioned. Switching windows to light or vs code to dark theme can temporary solve it/

VS Code version: Code 1.86.0 (05047486b6df5eb8d44b2ecd70ea3bdf775fd937, 2024-01-31T10:28:19.990Z) OS version: Windows_NT x64 10.0.22631 Modes:

System Info |Item|Value| |---|---| |CPUs|AMD Ryzen 7 6800H with Radeon Graphics (16 x 3194)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled| |Load (avg)|undefined| |Memory (System)|15.19GB (6.13GB free)| |Process Argv|--crash-reporter-id 944a687a-aab1-4e3c-9551-05aea9e1912f| |Screen Reader|no| |VM|0%|
Extensions (39) Extension|Author (truncated)|Version ---|---|--- Bookmarks|ale|13.4.2 laravel-extra-intellisense|ami|0.6.4 find-and-transform|Art|5.0.0 laravel-goto-view|cod|1.3.11 vs-treeview|DaG|2.7.0 composer-php-vscode|DEV|1.43.14858 phptools-vscode|DEV|1.43.14858 profiler-php-vscode|DEV|1.43.14858 gitlens|eam|14.7.0 vscode-html-css|ecm|2.0.9 EditorConfig|Edi|0.16.4 vsc-material-theme-icons|equ|3.4.0 figma-vscode-extension|fig|0.3.3 gitlab-workflow|Git|3.101.1 laravel-create-view|gli|0.0.6 laravel-blade-wrapper|IHu|1.0.1 php-symbols|lin|2.1.0 dotenv|mik|1.0.1 compare-folders|mos|0.24.2 vscode-docker|ms-|1.28.0 remote-containers|ms-|0.338.1 remote-ssh|ms-|0.108.0 remote-ssh-edit|ms-|0.86.0 remote-wsl|ms-|0.86.0 vscode-remote-extensionpack|ms-|0.25.0 remote-explorer|ms-|0.4.1 remote-server|ms-|1.5.0 laravel-goto-components|nao|1.2.0 laravel-blade|one|1.34.0 laravel-extension-pack|one|1.2.0 laravel5-snippets|one|1.17.0 laravel-jump-controller|pgl|0.0.33 vscode-yaml|red|1.14.0 laravel-artisan|rya|0.0.31 vscode-blade-formatter|shu|0.24.0 es6-string-html|Tob|2.14.1 twig|wha|1.0.2 php-debug|xde|1.34.0 php-intellisense|zob|1.3.3 (1 theme extensions excluded)
A/B Experiments ``` vsliv368cf:30146710 vspor879:30202332 vspor708:30202333 vspor363:30204092 vscod805:30301674 binariesv615:30325510 vsaa593cf:30376535 py29gd2263:30899288 c4g48928:30535728 azure-dev_surveyone:30548225 962ge761:30951796 pythongtdpath:30769146 welcomedialog:30910333 pythonidxpt:30866567 pythonnoceb:30805159 asynctok:30898717 pythontestfixt:30902429 pythonregdiag2:30936856 pyreplss1:30897532 pythonmypyd1:30879173 pythoncet0:30885854 pythontbext0:30879054 accentitlementsc:30887149 dsvsc016:30899300 dsvsc017:30899301 dsvsc018:30899302 dsvsc019bcf:30953938 3ef8e399:30949928 ```
arpadgabor commented 9 months ago

Can confirm this issue. On light themes the text cursor turns white. A couple of clicks turns it back to black but it doesn't stay for long before turning white again.

wendelloliveiradev commented 9 months ago

Same issue here. Cursor keeps turning white on light themes. I'm using metherial theme light during the day for better visibility, although the cursor turns white and I can't see it, this is a terrible bug, that impact tremendously on productivity, if possible make this issue CRITICAL. Thanks!

edgar1506 commented 9 months ago

I have the same issue, it's a pain trying to figure out where the cursor is...

YSHebron commented 9 months ago

I also have the same issue. It's also happening in my browser

maartendekeizer commented 9 months ago

Same issue in multiple light teams, dark teams are not affected.

Kdcius commented 9 months ago

Same here, windows on dark mode, VSCode on light theme and the cursor stay white on the light background.

MFreit50 commented 9 months ago

Same issue, for some reason when moving around the vs code window the issue gets fixed temporarily. Seems like a graphics card issue

clorch commented 9 months ago

The same issue seems to be described in https://github.com/microsoft/vscode/issues/204181 and https://github.com/microsoft/vscode/issues/205512.

korkis commented 8 months ago

I changed from light theme to dark theme

alexdima commented 8 months ago

:wave: Would it please be possible to run https://github.com/microsoft/vscode-bisect to pinpoint the problematic commit range where this was introduced?

Dimava commented 7 months ago

👋 Would it please be possible to run https://github.com/microsoft/vscode-bisect to pinpoint the problematic commit range where this was introduced?

@alexdima it pointed me to https://github.com/microsoft/vscode/compare/9bbc169b624175bb432d439adea1bf4cbb7156bc...12fece34ed49c972d85b1a9ff0f5b8532eea569c

Run the following commands to continue bisecting via git in a folder where VS Code is checked out to:

git bisect start && git bisect bad 12fece34ed49c972d85b1a9ff0f5b8532eea569c && git bisect good 9bbc169b624175bb432d439adea1bf4cbb7156bc

I will bisect it further tomorrow if I get VSCode to run from sources

Dimava commented 7 months ago

Currently using code --disable_direct_composition=1 (provided at https://github.com/microsoft/vscode/issues/204181#issuecomment-1970267047 ) to mitigate the problem

sercanio commented 7 months ago

Same here with version 1.88.0

EmanH commented 7 months ago

Having the same issue. version 1.88.1

marensas999 commented 6 months ago

Same here. Very annoying.

CamiloMartinezM commented 6 months ago

Same here, cursor turns white (it doesn't dissapear, it's just white and it blends in) and moving and clicking around turns it black again.

Version: 1.89.0 (user setup) Commit: b58957e67ee1e712cebf466b995adf4c5307b2bd Date: 2024-05-01T02:09:22.859Z Electron: 28.2.8 ElectronBuildId: 27744544 Chromium: 120.0.6099.291 Node.js: 18.18.2 V8: 12.0.267.19-electron.0 OS: Windows_NT x64 10.0.22631

PablitoKarramba commented 6 months ago

Still happens on light mode. The mouse pointer blends into the background

BigWhiteDog commented 6 months ago

I found an interesting thing. I had this problem when using my mini desktop computer, which has an AMD 7840HS CPU. However, the mouse cursor problem will be fixed if I connect it to a USB4 External GPU dock with NVIDIA 1660s.

sclyonsburke commented 6 months ago

I am having this problem too and it is making it difficult to get work done

mbalc commented 6 months ago

as a workaround I had to change to some different light theme that doesn't use pure white as background (Horla Light Theme, although I don't like its lack of contrasts on sidebar)

please fix, this issue is critical

deepak1556 commented 6 months ago

To confirm, do users still encounter the issue with latest insiders https://code.visualstudio.com/insiders ? If so, are you able to mitigate the issue using the cli flag --disable_direct_composition=1

Dimava commented 6 months ago

To confirm, do users still encounter the issue with latest insiders https://code.visualstudio.com/insiders ? If so, are you able to mitigate the issue using the cli flag --disable_direct_composition=1

Just checked, I immediately get white cursor on plain shortcut and don't seem to ever get white cursor on --disable_direct_composition=1 shortcut

Version: 1.90.0-insider (user setup)
Commit: 50f2b2eca8d5c6e19ec95f9d46a59f623e60cac3
Date: 2024-05-28T05:47:25.268Z
Electron: 29.4.0
ElectronBuildId: 9593362
Chromium: 122.0.6261.156
Node.js: 20.9.0
V8: 12.2.281.27-electron.0
OS: Windows_NT x64 10.0.22631
tibitoth commented 6 months ago

what are the side effects of --disable_direct_composition=1?

dp-op commented 6 months ago

I'm having the same problem! Makes it quite difficult to continue working.

nathansavari commented 5 months ago

Same issue

FiSuESoPe commented 5 months ago

To confirm, do users still encounter the issue with latest insiders https://code.visualstudio.com/insiders ? If so, are you able to mitigate the issue using the cli flag --disable_direct_composition=1

The latest insider version fixed the issue for me. Using --disable_direct_composition=1 fixes it in the current stable release (1.89) for me.

arisudesu commented 5 months ago

Issue still present on insider version, flag --disable_direct_composition=1 fixes it.

Version: 1.91.0-insider
Commit: 51d598183ea632c658c34e0a11da5706192a1b69
Date: 2024-06-12T05:49:43.246Z
Electron: 29.4.0
ElectronBuildId: 9593362
Chromium: 122.0.6261.156
Node.js: 20.9.0
V8: 12.2.281.27-electron.0
OS: Windows_NT x64 10.0.19045
piec commented 5 months ago

Is this the same bug? https://issues.chromium.org/issues/40239916

I have indeed and AMD GPU.

Edit: a workaround seems to be to use mpo_disable.reg + reboot. I haven't tried it yet because I'm not on the right PC, I also don't know about the performance impact. Sources:

bvazx commented 5 months ago

I tried it. Indeed, it works. Some sources on the Internet write that the load on the processor may increase, but I didn’t really notice… Actually, I didn’t notice at all.

piec commented 5 months ago

Yes, it worked for me too and I didn't notice an impact

Th3S4mur41 commented 5 months ago

Same Problem here on a Surface Pro 7+ (Core i7 with Iris Xe) since yesterday. Not sure if it started with the last VS Code Update or the Update to Windows 11 24H2 🤔

Also not sure if this is related, but the problem also appeared in Edge Canary DevTools around the same time

Version: 1.90.2 (user setup)
Commit: 5437499feb04f7a586f677b155b039bc2b3669eb
Date: 2024-06-18T22:34:26.404Z
Electron: 29.4.0
ElectronBuildId: 9728852
Chromium: 122.0.6261.156
Node.js: 20.9.0
V8: 12.2.281.27-electron.0
OS: Windows_NT x64 10.0.26100
arisudesu commented 4 months ago

Re-tested on 1.91.0, no argv flags, with recently released AMD Adrenalin 24.6.1 drivers. Cursor is still either blinking or disappears. Sticking to the mpo_disable.reg fix for now.

Версия: 1.91.0 (system setup)
Фиксация: ea1445cc7016315d0f5728f8e8b12a45dc0a7286
Дата: 2024-07-01T18:52:22.949Z
Electron: 29.4.0
ElectronBuildId: 9728852
Chromium: 122.0.6261.156
Node.js: 20.9.0
V8: 12.2.281.27-electron.0
ОС: Windows_NT x64 10.0.19045
Nirmal4G commented 4 months ago

Related #217357

c-foschi commented 2 months ago

I have the same problem, running withn a Nvidia gpu. flag --disable_direct_composition=1 fixes it for me, but I will have to turn to a dark theme because it's just unreasonable to me to make the flag always work. what a drag.

seesharprun commented 2 months ago

I just started experiencing the same issue in a dark theme on the Insiders build. Running code-insiders . --disable_direct_composition=1 works for me as a temporary workaround that also introduces other rendering issues.

TheoNicod commented 1 month ago

You can change the cursor color in the Windows settings. It's not a real solution, but it works for me.

guillaume-mueller commented 1 month ago

Absolutely the kind of very crappy behavior on Windows vs Linux.

This is a CRITICAL one !

I use AutoDarkMode, so I won't change anything permanently.

merryHunter commented 1 month ago

same thing on Lenovo Legion, windows, I am switching between theme modes (dark/light) and in light theme sometime cursor turns white and becomes invisible..

bvazx commented 1 month ago

It helps me. Moreover, the cursor works fine not only in VSCode but also in MSEdge.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Dwm] "OverlayTestMode"=dword:00000005

...and reboot. Revert.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Dwm] "OverlayTestMode"=-

...and reboot.

piec commented 1 month ago

same as mpo_disable.reg https://github.com/microsoft/vscode/issues/204103#issuecomment-2163999095

J-Ciro commented 1 month ago

Same Issue here.

It looks like that this is due to the new version of Windows 11 24H2.

GUZZ07 commented 1 month ago

Same Issue here.

It looks like that this is due to the new version of Windows 11 24H2.

I do not think it is caused by win11 24h2. I just upgrade my desktop with nvidia discrete gpu from win11 23h2 to 24h2 and do not meet this problem, but it occurs on my laptop with Intel arc iGPU and can be temporarily solved by disable hardware acceleration.

seba842005 commented 1 month ago

Same Issue here. It looks like that this is due to the new version of Windows 11 24H2.

I do not think it is caused by win11 24h2. I just upgrade my desktop with nvidia discrete gpu from win11 23h2 to 24h2 and do not meet this problem, but it occurs on my laptop with Intel arc iGPU and can be temporarily solved by disable hardware acceleration.

On my laptop with 24H2 problem was caused by automatic color adjustment in display settings.

dvv47 commented 1 month ago

Same Issue here. It looks like that this is due to the new version of Windows 11 24H2.

I do not think it is caused by win11 24h2. I just upgrade my desktop with nvidia discrete gpu from win11 23h2 to 24h2 and do not meet this problem, but it occurs on my laptop with Intel arc iGPU and can be temporarily solved by disable hardware acceleration.

On my laptop with 24H2 problem was caused by automatic color adjustment in display settings.

thats it thank you, disabling automatic color adjustments fixed problem

J-Ciro commented 1 month ago

Same Issue here. It looks like that this is due to the new version of Windows 11 24H2.

I do not think it is caused by win11 24h2. I just upgrade my desktop with nvidia discrete gpu from win11 23h2 to 24h2 and do not meet this problem, but it occurs on my laptop with Intel arc iGPU and can be temporarily solved by disable hardware acceleration.

On my laptop with 24H2 problem was caused by automatic color adjustment in display settings.

I see, i also disable it and now it's working fine and the issue disappeared.

oscb commented 1 month ago

Same Issue here. It looks like that this is due to the new version of Windows 11 24H2.

I do not think it is caused by win11 24h2. I just upgrade my desktop with nvidia discrete gpu from win11 23h2 to 24h2 and do not meet this problem, but it occurs on my laptop with Intel arc iGPU and can be temporarily solved by disable hardware acceleration.

On my laptop with 24H2 problem was caused by automatic color adjustment in display settings.

Where is this setting?

The only way I can make this problem disappear is disabling HDR. It happens with a dark theme too.

ismael-miguel commented 3 weeks ago

This started to happen to me after upgrading Windows 11 to the latest version.

Im using a Dell Latitude 3420 with Intel Xe graphics and an Omen 27" 165hz HDR display over HDMI. Everything is as updated as it goes.

This issue does happen on VSCode and on Google Chrome.

Disabling HDR and increasing the mouse cursor fixed the issue, but those arent usable workarounds for me.

However, I found a different workaround. One that works and is very usable.

  1. Open "Settings" and go to "Accessibility" > "Mouse pointer and touch"
  2. Select the "Custom" cursor - yes, the bright neon one
  3. Select a color - you have to enter #FFFFFF for white
  4. Scroll down and click on "Mouse", under "Additional settings"
  5. Scroll to the bottom and click on "Additional mouse settings", under "Related settings"
  6. Go to the "Pointers" tab
  7. Manually change all cursors to the Aero version EXCEPT the "Text Select" and "Precision Select"
  8. For "Precision Select", use "cursor_r.cur", "cursor_rl.cur" or "cursor_rm.cur" (the other ones disappear in Excalidraw - and may disappear in VSCode too)
  9. Save as a new profile
  10. Press "OK"And that's it! It seems that a combination of the default "theme" and the Aero "Normal Select" and "Text Select" causes this bug. Also, you should try to enable pointer shadows, if this doesn't work for you.

And yes, the ugly text select thingy is ugly ... but hey, I prefer that to a randomly disappearing cursor!


I found https://github.com/microsoft/vscode/issues/204181#issuecomment-1971097100 which offers a similar solution.

However, it leaves me with a different or huge cursor, which is not a solution for me. I don't like the Windows 8+ cursor, but it's better than the alternatives.

A2va commented 2 weeks ago

I have the same problem on a Lenovo with an AMD Ryzen 7 and Windows 11, but strangely it only happens when I'm connected to a remote target via SSH (it's a local VM, but that shouldn't change anything).

FriendlyUser1 commented 2 weeks ago

Also on Windows 11, my mouse pointer was disappearing when hovering over the editor pane, but it seems to have been caused by having the Windows Magnifier app open.

dnorac commented 2 weeks ago

Apparently there is a multiplicity of issues being reported here.

For some people, the cursor (usually the caret) turns white (on dark themes), whereas for other people it completely disappears (regardless of the theme being light or dark).

For some people, the fix is to disable Adaptive color (under System -> Display). For me (Intel Arc Graphics on an Intel 7 Core 155H), changing this setting was ineffective, but disabling HDR fixes it (which sucks, because I want to have HDR on).

The issue started occurring to me after upgrading to 24H2, whereas some people claim that it works on their 24H2 machines.

In my case, this problem also affects other components outside of Visual Studio Code. For example, the cursor disappears when hovering text inputs in HTML documents, or the address bar in Chromium-based browsers. This suggests that it's not really a VSCode problem, but a Microsoft Windows one.

In my case, switching from the default cursor to Window's dark cursor or switching to the green one (you can pick another color, such as white, as @ismael-miguel recommended) fixes it.