Search code examples
visual-studio-coderecovery

Where do deleted files go in VS Code installed as a Snap?


When using the VS code, I selected a folder in the left sidebar explorer and pressed the delete button. It prompted me saying

enter image description here

I clicked the Move to Trash button. However, now I cannot find this folder anywhere. There is also no undo delete button in vs code. I am using Ubuntu. So I looked into ~/.local/share/Trash/ and the deleted folder was not there. Where to find the file? I mean when VS code says "Trash", what directory is it referring to?

VS code version: (installed through snap)

Version: 1.97.2
Commit: e54c774e0add60467559eb0d1e229c6452cf8447
Date: 2025-02-12T23:20:35.343Z
Electron: 32.2.7
ElectronBuildId: 10982180
Chromium: 128.0.6613.186
Node.js: 20.18.1
V8: 12.8.374.38-electron.0
OS: Linux x64 6.8.0-40-generic snap

/etc/OS-release:

PRETTY_NAME="Ubuntu 22.04.5 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.5 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy

Solution

  • You might be using VScode installed from snap, which runs in a sandboxed environment which does't have access to ~/.local/share/Trash/

    Check:

    ls ~/snap/code/common/.local/share/Trash/files