sleistner / vscode-fileutils

Visual Studio Code Extension
https://marketplace.visualstudio.com/items?itemName=sleistner.vscode-fileutils
MIT License
190 stars 26 forks source link

Remote SSH | File remove says Trash but remote has no trash #483

Open alexkuc opened 2 years ago

alexkuc commented 2 years ago

Describe the bug I am using Remote SSH. When I do File Util: Delete I get message Move to Trash:

image

However, on remote (Ubuntu), I have no trash.

Is it issue with extension or my set up?

From what I was able to find, trash is currently not supported on remote SSH - https://github.com/microsoft/vscode/issues/108731. Although ticket talks about WSL, I believe the same would apply for local Mac - remote Ubuntu combo.

To Reproduce Steps to reproduce the behavior:

  1. Open Remote SSH folder
  2. Open command palette and do File Util: Delete
  3. Get confirmation message about Move to Trash
  4. Check actual trash folder locally (nothing found)

Expected behavior If Remote SSH in fact does not support trash, the message should warn that file is deleted permanently.

Desktop (please complete the following information):

alexkuc commented 2 years ago

When using native file explorer in VSCode, the only available option for removing files is permanent one:

Screenshot 2022-09-03 at 23 08 58

alexkuc commented 2 years ago

From what I can tell, Move to Trash is hard-coded? https://github.com/sleistner/vscode-fileutils/blob/7632f7edb12b28d3cda1b99910e4ba22587f68b1/src/controller/RemoveFileController.ts#L21

And the setting Files: Enable Trash (files.enableTrash) is actually controlled by VSCode itself?

Reference: https://code.visualstudio.com/docs/getstarted/settings

alexkuc commented 2 years ago

Also, examining the source code, I can see that file removal is actually delegated to VSCode core, right?

https://github.com/sleistner/vscode-fileutils/blob/1058e696ac4abf1f6e17b2f34b6c5a2bcd9e79a4/src/FileItem.ts#L64-L69

So, in this case, this extension cannot do much, except for maybe enable detection of Remote SSH and warn that file is deleted permanently? Since, for what I can tell, VSCode Remote SSH does not support trash/recycle bin yet.