Visual Studio Code is eating up hundreds of gigabytes on Linux

https://www.profitableratecpm.com/f4ffsdxe?key=39b1ebce72f3758345b2155c98e6709c

If you’re running out of space on your Linux desktop or laptop, Visual Studio Code could be the cause. There is a bug that causes some VS Code installations to never delete files after deleting them, which can potentially consume hundreds of gigabytes of storage.

When you delete a file or folder in Visual Studio Code, the data is usually moved to the Recycle Bin directory or Recycle Bin on your system. This way you can restore the file if necessary, at least until you empty the Trash. However, when Visual Studio Code is installed as a Snap package on a Linux computer, the file is moved to a Trash folder within the Snap package, instead of the system Trash.

This behavior prevents files from being recovered by opening the system Trash folder. More importantly, Visual Studio Code does not clean this Trash directory. If you “deleted” a file from your project six months ago, it may still be in the Snap container’s Trash directory.

You can check the Snap package Trash directory by navigating to the directory below, replacing “” with your system username.

/home//snap/code/current/.local/share/Trash

The “.local” directory may be hidden by some file managers. If you can’t find it, try running this command in Terminal:

xdg-open /home/$USER/snap/code/current/.local/share/Trash

The issue was initially reported in November 2024 and has not yet been resolved. One person said: “There are files in there from 2 years ago. Keeping files in the Trash forever seems to be a bug.” Another person responded: “I had almost 200GB of data that I thought had been previously deleted. »

This bug appears to only affect the Snap package version of Visual Studio Code on Linux. If you are using this version, I recommend uninstalling VS Code and using the official .DEB or .RPM packages instead. If your distribution does not support these package formats, you can run it from a folder with the .tar.gz download option, or try the unofficial version of Flatpak on Flathub.

Trash directory in VSCodium Snap package

VSCodium, a popular recompiled version of Visual Studio Code, also appears to be affected. I installed the Snap package version on Ubuntu 24.04 and when I deleted files they were moved to the trash directory inside the Snap container (called “codium” instead of “code”). As with standard Visual Studio Code, installing a non-Snap version should resolve the issue.

Hopefully, Microsoft fixes this bug in the near future, so that Visual Studio Code stops consuming hundreds of gigabytes of storage for no reason.

Source: GitHub via Chris Hayes (Mastodon)

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button