skip to Main Content

I am using VScode on a Mac, and the folder was opened from onedrive. every time I want to delete a file from VScode, it is actually moved to the root directory of onedrive. With the details explained below:

This is my onedrive folder:

This is my onedrive folder

This is the VScode interface, the folder "python_scripts" was opened from onedrive:
e.g. This is a folder opened from onedrive

When I want to delete the folder "an_example":
I want to delete it.

After I deleted it, the folder disappeared from "python_scripts", but show up in the onedrive root directory. Basically it is moved instead of deleted.
After I deleted it, it did not go into the trash, instead, it is moved to the Onedrive folder

I tried on a windows PC, no problems there. And I also tried with a local folder instead of onedrive, still no problem. Seems like it is just the problem on a Mac with onedrive. BTW, this is a onedrive account from university, not sure if that matters.

2

Answers


  1. I have the same issue with my VSCode on macOS, but I find that if the file/folder in OneDrive is deleted directly in the Finder, there will be no problem except that there might be a warning suggesting it will be removed permanently. So this is probably because of some bug in VSCode, or the limitation of removing a file/folder in OneDrive on the macOS, for it can only be deleted permanently in some circumstances. For now, I just disable the trash option in the VSCode settings and it works ok.

    Login or Signup to reply.
  2. I have got the same problem. Deleting Onedrive files/folders directly from Finder works well, but deleting from VSCode always moves them to the Onedrive root folder. According to the issue comment (https://github.com/microsoft/vscode/issues/174722#issuecomment-1438743143), this problem probably comes from Electron’s shell.trashItem() failing to deal with Onedrive’s special mechanism. Before the upstream bug is fixed, Changing personal habits to delete files/folders directly from Finder seems the best solution.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search