robole / vscode-file-bunny

Perform file actions quickly with keyboard-driven file selection. 🐰

Home Page:https://marketplace.visualstudio.com/items?itemName=robole.file-bunny

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot delete a file when working in remote workspace (no trash available)

fighur opened this issue · comments

The logs show the following error:

[error] Error (FileSystemError): Unable to delete file '...' via trash because provider does not support it.

Hi @fighur

Thanks for reporting the issue.

Can you clarify if you are working locally or remotely?

It appears there is no trash in WSL from the error you have reported.

The delete commands: File Bunny: Delete Active File and File Bunny: Delete File both use FileSystem.delete as below:

await vscode.workspace.fs.delete(selectedFileUri, { useTrash: true });

This extension was designed to make all destructive actions safe i.e enable recovery via trash for deleted files. I am reluctant to make an exception to that.

I am not a WSL user, I do not have a windows machine, so I will not be working on this. It is open to others to investigate.

Is there a way to tell that VS Code is operating in WSL?

My guess is that process.platform reports back the platform as win32. If there is not a way to tell that you are in WSL and the error is a generic FileSystemError, then it is difficult to offer different functionality for WSL.

You could just use VS Code in Windows, the functionality works as expected there.

Kind Regards,

Rob

Hello, the WSL does have a "trash". Actually, using vscode locally within the WSL works fine. It seems to be an issue with working remotely, not specific to the WSL (microsoft/vscode#108731).

Thanks for the update @fighur . I guess it is purely a remote issue then. If Microsoft implement the issue you mentioned, then it should close this issue. Does that summary sound correct to you?

I will update the title of this issue to reflect that.

Awaiting implementation of trash for remote environment - microsoft/vscode#108731