Where does the bug appear (feature/product)?
Cursor IDE
Describe the Bug
“Discard Changes” fails with “Failed to move item to trash” error on Linux Ubuntu
Steps to Reproduce
Add new file in repo
in source control click to discard changesfor a new file
click move to trash
Expected Behavior
Bug Report: “Discard Changes” fails with “Failed to move item to trash” error on Linux
Summary
When using “Discard Changes” in Source Control panel, Cursor fails with error: “Git: Failed to move ‘filename’ to the trash (Failed to move item to trash)”. This issue occurs only in Cursor, while Visual Studio Code works correctly with the same system configuration.
Environment
- OS: Ubuntu 25.04 (Plucky)
- Kernel: Linux 6.14.0-37-generic
- Architecture: x86_64
- Cursor Version: 2.2.43 (32cfbe848b35d9eb320980195985450f244b3030)
- Desktop Environment: Standard Ubuntu desktop
- Trash Location:
~/.local/share/Trash(exists and is accessible)
Steps to Reproduce
- Open any Git repository in Cursor
- Make changes to a file (or create a new file)
- Go to Source Control panel
- Right-click on the changed file
- Click “Discard Changes”
- Error dialog appears: “Git: Failed to move ‘filename’ to the trash (Failed to move item to trash)”
Expected Behavior
The file should be discarded (removed from working directory) and moved to trash, similar to how Visual Studio Code handles it.
Actual Behavior
Error dialog appears and the operation fails. The file remains in the working directory.
Comparison with VS Code
- Visual Studio Code: Works correctly - files are moved to trash when using “Discard Changes”
- Cursor: Fails with trash error
- Both applications are installed on the same system with the same user permissions
- Both use Electron framework
- Both have access to the same trash directory (
~/.local/share/Trash)
System Information
- Trash Directory:
/home/msi/.local/share/Trash(exists, permissions: drwx------) - gio command: Available at
/usr/bin/gio - libgio libraries: Installed (libgio-2.0-dev, libgio-2.0-dev-bin)
- XDG_DATA_HOME: Not explicitly set (defaults to
~/.local/share) - XDG_CACHE_HOME: Not explicitly set (defaults to
~/.cache)
Technical Details
- Cursor binary location:
/usr/share/cursor/cursor - Desktop file:
/usr/share/applications/cursor.desktop - VS Code works with identical system configuration
- The issue appears to be specific to how Cursor handles trash operations on Linux
Attempted Solutions
- Verified trash directory exists and has correct permissions
- Verified gio command is available and functional
- Verified libgio libraries are installed
- Checked that VS Code works correctly (for comparison)
- Attempted to set XDG_DATA_HOME and XDG_CACHE_HOME environment variables (did not resolve the issue)
Additional Notes
- This is a critical issue as it prevents normal Git workflow in Cursor
- The workaround of disabling trash (
files.deleteToTrash: false) is not acceptable as it removes functionality - VS Code demonstrates that trash functionality can work correctly on this system
- This suggests the issue is in Cursor’s implementation, not system configuration
Request
Please investigate why Cursor fails to move files to trash on Linux while VS Code (which uses the same Electron framework) works correctly. This appears to be a bug in Cursor’s trash handling implementation for Linux systems.
Screenshots / Screen Recordings
Operating System
Linux
Current Cursor Version (Menu → About Cursor → Copy)
2.2.43
32cfbe848b35d9eb320980195985450f244b3030
x64
Does this stop you from using Cursor
Yes - Cursor is unusable