-
Notifications
You must be signed in to change notification settings - Fork 30.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Linux: Unable to move file to trash upon delete #13189
Comments
@rajinder-yadav this indicates that the folder you have opened is maybe not able to move to trash, this can happen if the folder is from a network drive for example or you need other permissions to do so. Does it reproduce with any folder you open? |
There are 2 places I work from, my home folder or under /tmp in both cases I had no issues about deleting files. I just notice this problem the other day, I even tried restarting vscode, then I emptied my trash just to make sure it was not full. The problem persisted. I don't know what caused it, it happen once so far. I just created a new project and was able to delete files, so I am not sure how to repro it yet, just that it happened and would not go away. |
@rajinder-yadav and can you move to trash if you use the windows explorer? |
It's on Linux, and yes I can move files to from trash using the file explorer, both locations have global read/write permission. |
Ah sorry, didn't see this was linux. Looks like an upstream electron issue then, we just call into their function. If you can reproduce using Atom, I suggest filing a bug against them. |
I don't have a trash. Is there any chance of a configuration option to change 'Delete file' to unconditionally remove the file moving trying to move it to the trash? |
@davidgiven you can hold the Shift key and delete to bypass trash anytime. |
Delete issue on Linux resolved for me. found this: https://code.visualstudio.com/docs/setup/linux#_debian-and-moving-files-to-trash One annoying thing, please add a setting to stop making me confirm the delete. |
@rajinder-yadav I've tried that on ubuntu 16.10 but it didn't worked. What distro are you using? |
@marcelopm Kubuntu 16.10 |
This workaround seems to partially solve the issue:
ref: https://github.com/atom/tree-view/issues/=345#issuecomment-125778929 But now I have two trashcans, which is quite annoying specially because one is integrated to my desktop manager and the other is not. BTW soft-linking it to ~/.local/share/Trash doesn't work neither does mount bind: sudo mount -o rbind /home/user/.local/share/Trash /.Trash-1000 |
@bpasero going to open a new feature request to request silencing of getting nagged "are you sure" each time I want to delete a file. |
@marcelopm you're going to forget to empty one of those trash can now, I would not recommend this solution. It actually creates a new problem! |
👍 |
@marcelopm the workaround of create a directory /.Trash-1000 worked for me +1 to solve this bug |
This issue was fixed by But I would +1 for a flag to kill the popup window asking if I really want to put the file in trash. I don't need to be reminded that I can restore files from trash. For a permanent delete this question might be relevant though. But still.. If I permanently delete a file by mistake I can always restore it from git, so even in that case the question is a little bit too "nanny" for me. ;-) |
Still facing this issue. |
Still happening in 1.14.2, still an everyday annoyance... (Vscode shouldn't be assuming that a trash exists, or exists in a particular place --- they're not universal on Linux. This really needs to be configurable.) |
Trash stopped working on vscode started from shell after upgrade to 1.20.1. Ubuntu 17.10.
|
Trash works if I run with
|
Same here, on linux too. If I delete a file from native file explorer, it goes to trash like expected. If I delete using vscode, I always have the prompt: A Direct delete that goes in trash is actually much safer than a prompt for this no-trash delete. So the current way is more annoying, and less safe. It's an electron issue as it appears? edit I've an older laptop, same OS, where the deletion from vscode works fine, like native file explorer, and deleted files go in trash. Need to figure out, both vscode have same settings Oh I think it's what @mgolebiowski said, the older laptop has an older version of vscode, upgrading to latest to check @bpasero Yes confirmed: As of version
vscode is not able to send files to trash anymore, when deleting (when launching vscode from terminal: |
See this pull request: electron/electron#7178 In my case (Antergos Linux, which is Arch based), the problem is that the |
On Fedora 27, added |
Same issue with redhat 7.4. Manually calling gvfs-trash on a file works okay but not from within vs code or indeed atom. Happens when launching from desktop or command line. Switching to gio appears to fix it though. |
Working on Debian, with my data stored in a separate partition. I have created a /.Trash folder manually as described in the XDG specifications, deleting files from Nautilus creates a subfolder /.Trash/1000 (as it should according to the specs); however VS Code still doesn't know how to trash my files. Setting |
@brad-jones i've added that, but still not working. but Ubuntu 17.10 |
Has anyone looked at why launching from terminal behaves differently? Why does it use wrong driver in one case but not in other? |
Still broken in Ubuntu 18.04, with Problem only when launching via |
Still broken with latest release and
deleting file works perfectly fine if I open it from the desktop launcher instead of a terminal. I'm using ubuntu 18.04. |
I fixed this problem by installing the .deb available through the official downloads page NOT the Visual Studio Code application available by default in the Ubuntu Software Center.
|
I did the same, but in my case it didn't work. Perhaps some files
remained... Only using the launcher solves my problem for now.
|
I use .debs from downloads page and the problem occurs anyways. |
A workaround until this bug is fixed: sudo mv /usr/bin/code /usr/bin/codeReal
sudo sh -c "echo 'ELECTRON_TRASH=gio codeReal \$1' >> /usr/bin/code"
sudo chmod 777 /usr/bin/code # same permissions as original Then use (Works for me with Ubuntu 18.04.1 LTS and vscode 1.25.1) |
Added But not if I directly launch vscode through the ubuntu dash/dock/ubuntu software or by right click on the folder > open with the application vscode Ubuntu 18.04.1 LTS |
@manuel-di-iorio Try adding |
@kramerc it worked by adding the line into the |
Fyi there is now (tomorrows insider build) a setting |
FYI: Electron 3 fixes this, it replaces the usage of the deprecated |
Closing this issue given that we plan to release VSCode stable early February with Electron 3.x. If you want to benefit from the fix already, consider to use our insiders version that already contains the fix: https://code.visualstudio.com/insiders/ |
For what it's worth the
|
Steps to Reproduce:
This use to work, now I get the following error message:
Failed to move 'app.component.css' to the trash
I am then asked each time to click on the "Delete Permanently" button to actually delete the file?
The text was updated successfully, but these errors were encountered: