Have you noticed that disk space is filling up fast even when your Linux computer’s trash folder is empty? There’s a strong possibility that VS Code is responsible for it.

A not-so-recent issue in the Snap version of VS Code has cropped up again, and there’s no fix in sight.

An Absurd Bug

When you normally delete a file, it goes into the trash folder, located at ~/.local/share/Trash. GNOME has supported automated emptying of the trash at selected intervals through its settings for quite some time now.

So, let’s say you delete trash every seven days.

  • FauxLiving@lemmy.world
    link
    fedilink
    arrow-up
    30
    ·
    12 hours ago

    TL;DR:

    When you delete in VS Code it stores the files in

    ~/snap/code/<version#>/.local/share/Trash
    

    Which isn’t automatically emptied by gnome like ~/.local/share/Trash

    Updating the package also creates new copies of this directory under a new version, leaving orphaned files/directories which contain data that you deleted.

    • Ptsf@lemmy.world
      link
      fedilink
      arrow-up
      8
      ·
      11 hours ago

      Honestly this should be treated as a security vulnerability as well as a general bug, no?

      • FauxLiving@lemmy.world
        link
        fedilink
        arrow-up
        7
        ·
        10 hours ago

        The lines get kind of blurry, it’s a bug that allows people executing code as your user(not sure the specifics of snap’s security) to see things that you thought you deleted.

        This doesn’t give an attacker anything particularly useful. If they have that level of privileged already there are much more fruitful avenues of attack that don’t require digging through your trash.

        • Ptsf@lemmy.world
          link
          fedilink
          arrow-up
          1
          ·
          2 hours ago

          Fair enough. I just operate under the assumption deleted means deleted, I’d never toss Auth keys in userspace but I could absolutely see myself placing them temporarily in scripts I’d delete later.