Visual Studio Code open folder shows only a black window

I have installed the Visual Studio Code with pacman and when I open it when I click on the open folder, I am presented with just a black window with a cursor. I can close this window by pressing Ctrl + Shift + Q but not really able to open a separate folder. I guess this is because of the i3wm handling of floating windows but everything else seems to be working fine except for this. This is my machine:

inxi -Fxz                                                                          <<<
System:    Host: xps Kernel: 5.4.0-1-MANJARO x86_64 bits: 64 compiler: gcc v: 9.2.0 Desktop: i3 4.17.1 Distro: Manjaro Linux 
Machine:   Type: Laptop System: Dell product: XPS 15 9560 v: N/A serial: <filter> 
           Mobo: Dell model: 05FFDN v: A00 serial: <filter> UEFI: Dell v: 1.16.0 date: 07/26/2019 
Battery:   ID-1: BAT0 charge: 72.4 Wh condition: 72.4/97.0 Wh (75%) model: SMP DELL GPM0365 status: Full 
CPU:       Topology: Quad Core model: Intel Core i7-7700HQ bits: 64 type: MT MCP arch: Kaby Lake rev: 9 L2 cache: 6144 KiB 
           flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 44817 
           Speed: 800 MHz min/max: 800/3800 MHz Core speeds (MHz): 1: 800 2: 800 3: 800 4: 800 5: 800 6: 800 7: 800 8: 801 
Graphics:  Device-1: Intel HD Graphics 630 vendor: Dell driver: i915 v: kernel bus ID: 00:02.0 
           Device-2: NVIDIA GP107M [GeForce GTX 1050 Mobile] driver: N/A bus ID: 01:00.0 
           Display: x11 server: X.Org 1.20.5 driver: intel resolution: 1920x1200~60Hz 
           OpenGL: renderer: Mesa DRI Intel HD Graphics 630 (Kaby Lake GT2) v: 4.5 Mesa 19.2.2 direct render: Yes 
Audio:     Device-1: Intel CM238 HD Audio vendor: Dell driver: snd_hda_intel v: kernel bus ID: 00:1f.3 
           Device-2: Realtek type: USB driver: snd-usb-audio bus ID: 3-1.5:4 
           Sound Server: ALSA v: k5.4.0-1-MANJARO 
Network:   Device-1: Qualcomm Atheros QCA6174 802.11ac Wireless Network Adapter vendor: Bigfoot Networks driver: ath10k_pci 
           v: kernel port: f040 bus ID: 02:00.0 
           IF: wlp2s0 state: up mac: <filter> 
           Device-2: Qualcomm Atheros type: USB driver: btusb bus ID: 1-4:2 
           Device-3: Realtek RTL8153 Gigabit Ethernet Adapter type: USB driver: r8152 bus ID: 4-1.2:3 
           IF: enp14s0u1u2 state: down mac: <filter> 
Drives:    Local Storage: total: 476.94 GiB used: 17.49 GiB (3.7%) 
           ID-1: /dev/nvme0n1 vendor: Samsung model: PM981 NVMe 512GB size: 476.94 GiB 
Partition: ID-1: / size: 58.59 GiB used: 12.02 GiB (20.5%) fs: f2fs dev: /dev/nvme0n1p10 
           ID-2: /home size: 120.59 GiB used: 5.47 GiB (4.5%) fs: f2fs dev: /dev/nvme0n1p11 
           ID-3: swap-1 size: 15.63 GiB used: 0 KiB (0.0%) fs: swap dev: /dev/nvme0n1p8 
Sensors:   System Temperatures: cpu: 57.5 C mobo: N/A 
           Fan Speeds (RPM): cpu: 2525 fan-2: 2528 
Info:      Processes: 226 Uptime: 1h 03m Memory: 15.48 GiB used: 2.02 GiB (13.0%) Init: systemd Compilers: gcc: 9.2.0 
           Shell: zsh v: 5.7.1 inxi: 3.0.36

What is the output when you run this command

xdg-mime query default inode/directory

in a terminal window?

Does it show PCManFM (or your default file manager in case it's not PCManFM) as the default handler?

Hi @bill_t the output of your command is pcmanfm.desktop but I still can't open directory with Visual Studio Code. I have noticed that in my mimeapps.list the inode/directory is set to exo-file-manager.desktop but even if I change it to pcmanfm.desktop the Visual Studio Code is showing me a black screen when I try to open a folder. I am also running i3wm on another machine and there Visual Studio Code works normally.

I have even changed the default file manager to thunar but I am still presented with the black screen when I am trying to open a folder in VSCode. The same behavior is with Atom which is very similar to VSCode. I can actually open the code from command line by pointing to the directory I want to open by executing code /path/to/work/dir/

I thought that this might be a MIME type issue, but apparently it's not, as your configuration in the mimeapps.list file is correct.

I'm not using the two editors you mentioned, but if I'm not mistaken they are both based on Electron.
This makes me think that the issue might (?) be related to Electron, so the first thing I would suggest is searching in Electron's bug tracker for a related report (or even in the bug trackers of Atom and Visual Studio Code).

I have a Dell XPS 13 7390 and a similar issue: chromium and electron do not refresh window content except when you resize the window. For example you type something and nothing happens, but then you resize the window and now it works.

So when you open a new window you see the first render it did and then it looks stuck. VSCode does exactly that.

I tried searching for bug reports but could not find much. On the Ubuntu that was preinstalled on my machine this bug was not present.

EDIT: if you run vscode with --disable-gpu it works fine, but there is no hardware acceleration.

1 Like

yes, I am also having this bug on Dell XPS 9560, so it might be something connected. I have found a work-around to open the code from terminal and point to the directory you want to open but it is far from perfect. Unfortunately the --disable-gpu doesn't work here. I have created an alias for VSCode alias code="code /path/to/your/programming/directory"

I noticed that if I run glxgears on my machine the gears are stuck and look like they are pulsating. They only redraw while I am resizing the window. Seems that some hardware accelerated content is hitting this bug, however Firefox for example can play hardware accelerated content at perfect 60 FPS and the laptop fans don't even turn on.

For now only chromium, electron based apps, and glxgears have the "frozen image except when resizing window" bug but if it happens in glxgears then it's not a chromium bug.

Yes, I was also wondering if it is not connected with the GPU drivers. What GPU switching tool are you using?

None: the Dell XPS 13 only has the integrated Intel graphics, there is no discrete graphics card.

Yes, you are right, I forgot about that. The Dell XPS 9560 is having a hybrid graphics.

I have solved the issue on my machine. I uninstalled xf86-video-intel and now everything works, no more stuck image in chromium or glxgears. Hardware acceleration is still present I imagine due to the kernel driver. I am on kernel 5.4 which I installed hoping it would fix the issue, so maybe to work properly we also need kernel 5.4. I will try 5.3 later and report

This also fixed KDE Plasma being unusable due to glitches, it now runs perfectly

EDIT: Also works fine on Kernel 5.3

Well done, mate! Cheers. I also found my problem and it is connected with the floating windows sizing. For some reason the floating windows were too large, that is why they were not shown on the screen. I have fixed it by restraining their maximum size as shown in the documentation: I have just added the following option in my .i3/config file:

floating_maximum_size 1000x800

And after I have reloaded the i3wm with $mod+Shift+R the floating windows displayed just fine for me. You can also try the @fazo96 solution and uninstall the xf86-video-intel driver, but his problem seems more like video card/drivers related.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.

Forum kindly sponsored by