You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feature Request]: trashItem can't use POSIX separator on Windows #28831
changed the title [-][Feature Request]: trashItem can't use POSIX separator in Windows[/-][+][Feature Request]: trashItem can't use POSIX separator on Windows[/+]on Apr 25, 2021
This is currently expected behavior, Electron APIs that take in file paths required resolved paths with the correct path separators.
This is very easy to do with path.resolve but supporting posix paths on windows comes with a myriad of edge cases that I'd rather not introduce to Electrons API surface
This also caught me out - it is a bit strange because all other fs APIs I've used in my app do work correctly with forward or mixed slashes. It's also a bit surprising because the native Win32 APIs (in C++, etc) do usually support both types of slash. I'll see how easy it is to submit a documentation change.
Activity
[-][Feature Request]: trashItem can't use POSIX separator in Windows[/-][+][Feature Request]: trashItem can't use POSIX separator on Windows[/+]MarshallOfSound commentedon Apr 25, 2021
This is currently expected behavior, Electron APIs that take in file paths required resolved paths with the correct path separators.
This is very easy to do with
path.resolvebut supporting posix paths on windows comes with a myriad of edge cases that I'd rather not introduce to Electrons API surfaceWingDust commentedon Apr 26, 2021
if that Should explain in Doc with trashItem
miniak commentedon Jun 25, 2021
@WingDust you can contribute the documentation change with a PR
MarshallOfSound commentedon Nov 13, 2022
Closing per the comment in #28831 (comment)
If someone wants to add docs around this PRs welcome, but the change to support posix paths is not something we'll do
sammarshallou commentedon Nov 21, 2025
This also caught me out - it is a bit strange because all other fs APIs I've used in my app do work correctly with forward or mixed slashes. It's also a bit surprising because the native Win32 APIs (in C++, etc) do usually support both types of slash. I'll see how easy it is to submit a documentation change.
Update shell.md: Document that shell.trashItem requires backslashes
Update shell.md: Document that shell.trashItem requires backslashes
docs: Update shell.md: Document that shell.trashItem requires backsla…
docs: Update shell.md: Document that shell.trashItem requires backsla…
docs: Update shell.md: Document that shell.trashItem requires backsla…
docs: document that `shell.trashItem` requires backslashes (#49038)
docs: Update shell.md: Document that shell.trashItem requires backsla…
docs: Update shell.md: Document that shell.trashItem requires backsla…
docs: Update shell.md: Document that shell.trashItem requires backsla…
docs: document that `shell.trashItem` requires backslashes (#49481)
docs: document that `shell.trashItem` requires backslashes (#49480)
docs: document that `shell.trashItem` requires backslashes (#49479)