docs: document that shell.trashItem requires backslashes (#49038)

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
This commit is contained in:
sam marshall
2026-01-21 18:21:01 +00:00
committed by GitHub
parent 22e8cf9416
commit d141934885

View File

@@ -86,6 +86,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.