"Discard Changes" fails with "Failed to move item to trash" error on Linux Ubuntu

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

  1. Open any Git repository in Cursor
  2. Make changes to a file (or create a new file)
  3. Go to Source Control panel
  4. Right-click on the changed file
  5. Click “Discard Changes”
  6. 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

  1. Verified trash directory exists and has correct permissions
  2. Verified gio command is available and functional
  3. Verified libgio libraries are installed
  4. Checked that VS Code works correctly (for comparison)
  5. 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

Video with example vs code working

Hey, thanks for the detailed report with the video and technical info. The issue is confirmed, it’s a bug in Cursor’s trash implementation on Linux.

I’ll pass this on to the dev team. Your comparison with VS Code and the detailed system diagnostics are really helpful.

Temporary workaround (until it’s fixed):

  1. Settings > search for “files.deleteToTrash”
  2. Disable this option

Yes, files will be deleted immediately without going to the trash, but at least “Discard Changes” will work.

I’ll let you know when there’s a fix.

This topic was automatically closed 22 days after the last reply. New replies are no longer allowed.