From 126a32c5d2be66cea3053365d75e7eb39cec2e1f Mon Sep 17 00:00:00 2001 From: "trop[bot]" <37223003+trop[bot]@users.noreply.github.com> Date: Wed, 21 Jan 2026 14:52:13 -0500 Subject: [PATCH] docs: document that `shell.trashItem` requires backslashes (#49479) docs: Update shell.md: Document that shell.trashItem requires backslashes In Windows many functions relating to files (e.g. shell.openItem, the Node fs functions, as well as native Win32 APIs) will accept either type of slash / or \ as a folder separator. shell.trashItem does not work with / as folder separator in Windows. This documentation change explains that. See also: https://github.com/electron/electron/issues/28831 Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: sam marshall --- docs/api/shell.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/api/shell.md b/docs/api/shell.md index 80e720b8f4..9d115449a1 100644 --- a/docs/api/shell.md +++ b/docs/api/shell.md @@ -58,6 +58,10 @@ Rejects if there was an error while deleting the requested item. This moves a path to the OS-specific trash location (Trash on macOS, Recycle Bin on Windows, and a desktop-environment-specific location on Linux). +The path must use the default path separator for the platform (backslash on +Windows). Use `path.resolve()` from the `node:path` module to ensure correct +handling on all filesystems. + ### `shell.beep()` Play the beep sound.