Skip to content

Fix: List the Recycle Bin on macOS without Full Disk Access - #250

Open
lextm wants to merge 1 commit into
MemerGamer:mainfrom
lextudio:macos/trash-without-fda
Open

lextm wants to merge 1 commit into
MemerGamer:mainfrom
lextudio:macos/trash-without-fda

Conversation

@lextm

@lextm lextm commented Dec 6, 2026

Copy link
Copy Markdown

Resolved / Related Issues

Part of the macOS port. macOS protects listing ~/.Trash, not moving items into it, so without Full Disk Access the Recycle Bin looked empty.

  • Items are trashed with NSFileManager trashItemAtURL; the original location, deletion time and size go into an app-data index (trash-index.tsv), so they list without Full Disk Access. With access, the rest of ~/.Trash is merged in.
  • When macOS blocks the listing, an InfoBar offers to open System Settings (new ITrashService.IsListingRestricted(), always false on Linux).
  • Trashed directories are no longer sized recursively, so a large trash cannot stall the listing.
  • Finder's .DS_Store and .localized are skipped.

Limitation: items trashed by the previous macOS code kept their origin in TrashIndex/ sidecars, which are no longer read; they show "original location unknown".

Steps used to test these changes

  1. macOS and Linux builds succeed.
  2. dotnet test --project tests/Files.Platform.Tests/Files.Platform.Tests.csproj --no-build --filter "FullyQualifiedName~Trash": the 3 new MacOSTrashServiceTests pass; the remaining failures on macOS are the Linux-only trash tests that fail identically on main.
  3. The InfoBar was not checked in this branch's running app.

🤖 Generated with Claude Code

Trash items through NSFileManager and keep their original location in an
app-data index, so the Recycle Bin lists them even when macOS blocks reading
~/.Trash; offer to open System Settings when it does. Size trashed
directories lazily so a large trash cannot stall the listing, and skip
Finder's .DS_Store and .localized files.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant