mdarefull
mdarefull

Reputation: 1039

VS Code main window is blank

Yesterday I downloaded the last version of VS Code and installed it.

When I launched it, at first, it seems to work fine, I went directly to the extension sections in order to check and download some, then I tried to change the sorting options to see the recommended extensions and then it was when the first symptom appeared. I clicked the button and nothing happened, I clicked it several times and after a while, the window for selecting the type of sorting appeared several times too (possible once for each time I clicked the button). I chose the recommended extensions, and no extension appeared.

I closed it and reopened it again, but this time, the main window was completely blank (actually, black). I restarted the PC, uninstalled the application, run CCleaner to clear the registry, reinstalled the application, all of that several times and nothing.

Sometime, after a long time running, it shows the usual sections, but when I close it and reopen it again, everything is the same. Also, some options from the tool windows doesn't work, while other do (like the about window).

I've checked this FAQ: https://code.visualstudio.com/docs/supporting/faq#_vs-code-main-window-is-blank but the solution there didn't work neither.

I had a previous version of vscode that worked great. Sadly, I cannot remember which one was, not even a close guest and I removed it when I noticed that installing this new version didn't removed it.

This is how VS Code looks like when I open it: enter image description here

This is the about window: enter image description here

This is a snapshot of the task manager a few seconds after vscode is launched: enter image description here

And these are my computer properties: enter image description here

Did anyone experience a simmilar situation before? Does anyone know how to fix it?


UPDATE 1

When I installed this new version, I noticed that it didn't remove the previous version of the application that was installed (and working). (This version instead of living on ProgramFiles was living on my User folder, I think on the Local AppSettings)

Then I proceed to uninstall it but stupidly missed the install entry at "Program and Features" and thought it wasn't registered there then I went to see if I could see an uninstaller, which I missed too. The rest of the story is obvious, because I though having these two versions was the problem I was determined to remove this last one and did it by manually deleting the folder, cleaning the registry, etc...

I'm writing this because, maybe, this old version left behind some configuration or registry information that would have been removed if I had followed the correct approach and, although my efforts to manually remove any trail, this is causing the new version to malfunction. For example, I still have the option on the explorer's context menu to open a file with Code, this option belongs to the old version and when clicked, the error message: "Application Not found" is shown.

Upvotes: 25

Views: 69724

Answers (16)

Marcello Marino
Marcello Marino

Reputation: 157

For Ubuntu users, it is possible you have installed Mesa OpenGL or some library as dependencies (sudo apt autoremove). The option command

--disable-gpu --disable-software-rasterizer

runs without using the libraries. The problem is there.

Upvotes: 0

Rohan Rao
Rohan Rao

Reputation: 2603

I know I am late for this answer, but unfortunately nothing worked above mentioned answers. So here is my answer:

I have been looking into this issue since 3 days! And finally, I am happy that it is working.

Upvotes: 0

Tim
Tim

Reputation: 96

VSCode worked great for me, but at some point something broke and it showed only a blank black screen. That is, the problem was clearly not in the GPU. By brute force, I determined that the cause was a violation of the file %AppData%\Roaming\Code\User\globalStorage\state.vscdb

I removed it and VSCode worked like new.

Upvotes: 2

zs2020
zs2020

Reputation: 54514

Use both --disable-gpu --disable-software-rasterizer

Upvotes: 4

Haritsinh Gohil
Haritsinh Gohil

Reputation: 6272

I have added --disable-gpu in shortcut's target tab but still it was not working and then tried to reinstalling the vscode but still no luck.

So in my case problem was my antivirus, it was quarantining the file workbench.desktop.main.js of vscode which is needed while running the program, so therefore it was not running and was showing black screen,

So i have excluded the parent folder of that workbench.desktop.main.js file which was workbenchfolder and reinstalled the vscode now it is running perfectly as it was.

Upvotes: 2

Raghav S
Raghav S

Reputation: 1

Right Click > Visual Studio Properties

Add --disable-gpu

enter image description here

Upvotes: -1

Rahul Misra
Rahul Misra

Reputation: 669

Deleting %appdata%\Code\User directory fixed the problem for me.

Upvotes: 2

Plaute
Plaute

Reputation: 4889

For me, it was after I added a new folder.

parameter disable-gpu didn't work.

So, I removed directory "code" from "roaming" and I found again VS Code.

Upvotes: 0

Leonardo Massaccesi
Leonardo Massaccesi

Reputation: 1

I experienced it too recently on a win8.1 os. It happened because i wrongly setted the gpu card as the default one for running visual studio code. A partial solution is to disable the gpu card by adding --disable-gpu (as previously suggested) by Right-clicking on VS-Code Shortcut on your desktop -> properties -> add --disable-gpu to Target field:

"C:\....your path ..\Microsoft VS Code\Code.exe" --disable-gpu

By doing so it fixes the problem only if u launch the program by that shortcut icon. On the other hand, suppose u browse your file system and let's say you navigate into a project folder. Once inside it, if you right click and select "open with code" ..the blank window will be shown again.

So, since in my case i have an Nvidia Card i run the Nvidia control panel from where u can check your global settings and specific settings. Under the global settings, set "automatic selection" as preferred graphic processor. Also check the other tab too "program setting" and see if u added there visual studio code and if the gpu card was chosen. If yes..well disable it.

Upvotes: 0

datta ambareesh
datta ambareesh

Reputation: 161

To fix this, follow these steps:

  1. Right-click on Visual studio code Shortcut.
  2. Click on properties.
  3. Go to shortcut tab.
  4. Add --disable-gpu to Target.

It will look like this:

"C:\Program Files\Microsoft VS Code\Code.exe" --disable-gpu

Upvotes: 4

Alexander
Alexander

Reputation: 1

Installing directx works for me =)

Upvotes: -2

Mahabir Singh Rawat
Mahabir Singh Rawat

Reputation: 41

I have same VS code black out issue. In command prompt(cmd) run below command
"code --disable-gpu"

working for me :)

Upvotes: 3

Sujoy Pal
Sujoy Pal

Reputation: 81

Try changing the compatibility mode of VS code. Please find the illustrated image here

Upvotes: 8

mona rathi
mona rathi

Reputation: 111

I had same problem in windows 7,have resolved by following above 2 steps:

1.Right-click on VS Code Shortcut -> go to properties -> add --disable-gpu to Target:

"C:\Program Files\Microsoft VS Code\Code.exe" --disable-gpu

2.setting the compatibility with windows 7 in VsCODE shortcut properties.

Upvotes: 11

Markus
Markus

Reputation: 839

To fix this for VS Code 1.18 (8 November 2017)

Right-click on Shortcut and add --disable-gpu to Target:

"C:\Program Files\Microsoft VS Code\Code.exe" --disable-gpu

enter image description here

Upvotes: 49

Rodrigo Passos
Rodrigo Passos

Reputation: 61

I had the same problem in windows 10, and it was resolved by setting the compatibility with windows 8 in VsCODE shortcut.

enter image description here

The image above is in Portuguese, please translate to your language.

Upvotes: 5

Related Questions