vscode: Freeze when deleting files via trash
- VSCode Version: 1.46.1
- OS Version: openSUSE Tumbleweed
- TypeScript: 3.7.5 (project) 3.9.4 (vscode)
Steps to Reproduce:
npx create-react-app --typescript --use-npm my-app
code my-app
- Copy paste
App.tsx
file toApp copy.tsx
- Delete
App copy.tsx
- VS Code window freezes for 5~10 seconds
Does this issue occur when all extensions are disabled?: No
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 33
- Comments: 29 (8 by maintainers)
The issue is that KDE (why I assume you are using) uses a different electron backend for managing file deletion.
It’s actually super slow when moving files to the trash.
You can specify the backend globally and fix this issue this way, you can see more in a post I wrote about this: https://jamezrin.name/fix-visual-studio-code-freezing-when-deleting
Temporary workaround confirmed on ArchLinux + KDE
I’m running KDE on Arch and I still have the same issue.
The fix You can fix this issue by creating a file that gets executed automatically on startup/login. I chose to do it in ~/.config/plasma-workspace/env/electron-trash-gio.sh
Edit that file and put this line
Copy export ELECTRON_TRASH=gio After that, reboot or logout and log back for it to apply.
Try this it worked for me
@guoyunhe currently we do not have a different process that can run this method. If do not want to move it into the electron main process as blocking that process would mean any user interaction is blocked across all windows. I think Electron needs to resolve this, or maybe run it in a different thread if it is known to block.
Potential workaround (works for me) described in this comment on a duplicate issue: https://github.com/microsoft/vscode/issues/90034#issuecomment-582115953 (Setting
ELECTRON_TRASH
environment variable)So to be clear: Shift+Click to fix temporarily until VSCode gets updated to Electron 12? (Manjaro-Linux w/ KDE)
Is there a timeframe for Electron12 update? Thanks for looking into this fellas!
@bpasero The root is fixed in the runtime https://github.com/electron/electron/pull/25114, we should adopt the async api to resolve on our end. Please reassign to the owner of this code path. Thanks!