vscode-fileutils icon indicating copy to clipboard operation
vscode-fileutils copied to clipboard

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

Open alexkuc opened this issue 3 years ago • 3 comments

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):

  • VSCode Version: 1.71.0
  • OS Version (local): macOS Big Sur 11.6.4
  • OS Version (remote): 20.04.5 LTS
  • FileUtils Extension Version: v3.5.0 (installed on remote)

alexkuc avatar Sep 03 '22 20:09 alexkuc

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 avatar Sep 03 '22 20:09 alexkuc

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 avatar Sep 03 '22 20:09 alexkuc

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.

alexkuc avatar Sep 03 '22 20:09 alexkuc