sxyazi/yazi · error · io::Error

item is not in the trash

Error message

item is not in the trash

What it means

Error "item is not in the trash" thrown in sxyazi/yazi.

Solutions

  1. The item is not inside ~/.Trash; only items in the trash can be restored or purged.

When it happens

Trigger: Thrown at yazi-fs/src/trash/macos/trash.rs:50 when the library encounters an invalid state.

Common situations: Operating on a macOS trash item whose path is not actually located inside ~/.Trash.


AI-assisted analysis of sxyazi/yazi@8ebf930f17 (2026-08-19). Data as JSON: /api/errors/0c7229347c25f0da. Report an issue: GitHub.

Appendix: source

Thrown at yazi-fs/src/trash/macos/trash.rs:50

		it.map(|dent| {
			let dent = dent?;
			if let Some(entry) = entry {
				entry.child(dent.file_name())
			} else {
				let path = dent.path();
				let original = store
					.get(path.file_name().unwrap_or_default())
					.and_then(|ds| ds.join(Path::new("")).ok());
				TrashEntry::top(path.clone(), path, original)
			}
		})
		.collect()
	}

	pub(crate) fn entry(&self, id: &TrashId) -> io::Result<TrashEntry> {
		let root = self.root()?;
		if id.top().parent() != Some(&root) {
			return Err(io::Error::new(io::ErrorKind::InvalidInput, "item is not in the trash"));
		}
		if id.has_rel() && !fs::symlink_metadata(id.top())?.file_type().is_dir() {
			return Err(io::Error::new(io::ErrorKind::InvalidInput, "trash item is not a directory"));
		}

		let store = DsStore::parse(&root.join(".DS_Store")).unwrap_or_default();
		let name = id.top().file_name().unwrap_or_default();
		let original = store.get(name).and_then(|ds| ds.join(id.rel()).ok());

		TrashEntry::new(id.clone(), id.path(), original)
	}

	pub(crate) fn metadata(&self, entry: &TrashEntry, follow: bool) -> io::Result<Cha> {
		Ok(if follow { entry.cha } else { entry.lcha })
	}

	pub(crate) fn revalidate(
		&self,

View on GitHub (pinned to 8ebf930f17)