microsoft / vscode

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

Ubuntu 18.04.4 : Launching VSCode from a launcher (a system shortcut) takes long time and fails to retrieve/install/show any extensions #104236

Closed Shaltz closed 3 years ago

Shaltz commented 4 years ago

Steps to Reproduce:

FAILS :

  1. Launch VSCode using a launcher ( ie a shortcut, accessible by using the SUPER key and then typing 'vscode' in the search bar)...and wait a good 20s for it to load...
  2. Go to the Extension tab
  3. nothing there and It keeps waiting forever (literally, I can leave my computer on for a week, nothing will be loaded...)

WORKS :

  1. Launch VSCode using the terminal by typing "code", it loads instantly
  2. Go to the Extension tab
  3. all the extensions are there and ready to be installed

Does this issue occur when all extensions are disabled?: Not working on linux apparently

any idea ??

Shaltz commented 4 years ago

Workaround: Create a custom launcher with a different icon to recognise it

Create a file ~/.local/share/applications/VSCode.desktop

in it, add this bit of code :

[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Exec=/usr/bin/code
Name=VSCode Working
Comment=Virtual Studio Code
Icon=/home/some_user/some/location/VSCode_icon.png

and now you can search for it like any other application, it will launch fast and extensions will work

Tyriar commented 4 years ago

With the deb package, could you run this:

cat /usr/share/applications/code.desktop

The Exec is likely this:

Exec=/usr/share/code/code --no-sandbox --unity-launch %F

Is running /usr/share/code/code --no-sandbox --unity-launch from a terminal manually slow as well? It is fast on my machine.

Shaltz commented 4 years ago

With the deb package, could you run this:

cat /usr/share/applications/code.desktop

The Exec is likely this:

Exec=/usr/share/code/code --no-sandbox --unity-launch %F

Is running /usr/share/code/code --no-sandbox --unity-launch from a terminal manually slow as well? It is fast on my machine.

Hi,

I've tried what you recommend and I end up with the same behaviour... slow to launch and the extensions are not loaded... I followed up by calling

/usr/bin/code --no-sandbox --unity-launch

instead, and it works like a charm...

<TL;DR> I feel like there is something to do with which executable is called... on my machine, if you call the exec located here

/usr/share/code/code

it s slow and the extensiosn don't load

if you call

/usr/bin/code

it works like perfectly....

jerome-massey commented 4 years ago

I'm experiencing the same issues. I've noticed that if close all VS Code windows and launch Code via the terminal pointing to either /usr/share/code/code or /usr/bin/code the application launches quickly and extensions work. When launching via the GUI (KDE Plasma) it takes much longer to load and the extensions aren't working. I changed the application launcher to point to /usr/bin/code --no-sandbox --unity-launch and now the application loads quickly via the GUI and extensions work.

Ubuntu 20.04.01 KDE Plasma 5.18

Shaltz commented 3 years ago

Hi, any news about this ?? I've found another thread, related to Ubuntu 20.04 (I've moved to Ubuntu 20.04) that referes to the exact same problem... https://github.com/microsoft/vscode/issues/98765

After a fresh reinstall of ubuntu 20.04 on a brand new HDD, I face the exact same issue... I still can't get vscode to load quickly and with the extensions working on my system without having to play around with my .desktop files....

any idea ??

EDIT: I fon't know if that helps but this time I installed VSCode from a snap... :/