sxyazi/yazi · warning · io::Error
Unsupported
Unsupported
Error message
trash is not supported on this platform
What it means
On platforms without trash support, the unsupported Trash backend is compiled in and every operation returns io::ErrorKind::Unsupported. list() unconditionally throws this — trash listing is simply not available on this platform.
Source
Thrown at yazi-fs/src/trash/unsupported/trash.rs:12
use std::{io, path::Path};
use super::super::{TrashEntries, TrashEntry, TrashId};
use crate::{cha::Cha, file::File};
pub struct Trash;
impl Trash {
pub fn new() -> io::Result<Self> { Ok(Self) }
pub fn list(&self, _entry: Option<&TrashEntry>) -> io::Result<Vec<TrashEntry>> {
Err(io::Error::new(io::ErrorKind::Unsupported, "trash is not supported on this platform"))
}
pub fn entry(&self, _id: &TrashId) -> io::Result<TrashEntry> {
Err(io::Error::new(io::ErrorKind::Unsupported, "trash is not supported on this platform"))
}
pub fn metadata(&self, _entry: &TrashEntry, _: bool) -> io::Result<Cha> {
Err(io::Error::new(io::ErrorKind::Unsupported, "trash is not supported on this platform"))
}
pub(crate) fn revalidate(
&self,
_entry: Option<&TrashEntry>,
_current: &File,
) -> io::Result<Option<File>> {
Err(io::Error::new(io::ErrorKind::Unsupported, "trash is not supported on this platform"))
}
View on GitHub (pinned to 5f901b886b)
Solutions
- Check platform support before invoking trash APIs and hide/disable trash UI
- Use a manual 'move to folder' fallback instead of the trash
- Build for a platform with a supported trash backend
Defensive patterns
Strategy: fallback
Try / catch
match trash.list(None) {
Err(e) if e.kind() == io::ErrorKind::Unsupported => show_fallback_view(),
other => other?,
} Prevention
- Detect platform trash support at startup and disable trash features
- Provide a move-to-folder fallback when Unsupported is returned
- Avoid assuming a trash backend exists in cross-platform code
When it happens
Trigger: Calling Trash::list() (or any Trash API) on a platform compiled with the unsupported backend (e.g. non-macOS/Windows without a trash implementation).
Common situations: Running yazi on a platform lacking trash support, or a build where the trash feature is disabled; code paths assuming a working trash backend.
Understand the failure class
Background: "unsupported platform" / "not supported on this platform" errors: what they mean and how to fix them — this error's family across 47 libraries.
Related errors
- Trash not supported
- NotFound
- restore target already exists: {to:?}
- invalid trash item path
- trash item is not a directory
AI-assisted analysis of sxyazi/yazi@5f901b886b (2026-09-02).
Data as JSON: /api/errors/23dca06f9fed756d.
Report an issue: GitHub.