Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(windows): fix that_detached for UNC path of a directory #107

Merged

Conversation

amrbashir
Copy link
Contributor

@amrbashir amrbashir commented Jan 5, 2025

closes #106

Strip UNC (\?\\) prefixes when opening directories using the dunce crate.

This PR also falls back to ShellExecuteExW in the rare case that SHOpenFolderAndSelectItems might fail, very unlikely but still good to do IMO.

However, I should note that SHOpenFolderAndSelectItems in some cases, instead of returning an error, it falls back to opening a default directory which is usually the Documents folder, this PR does not fix that as the Windows API doesn't return an error for it.

closes Byron#106

This PR also fallsback to `ShellExecuteExW` if `SHOpenFolderAndSelectItems` fails
Copy link
Owner

@Byron Byron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a million!

I will create a new release right away: https://github.com/Byron/open-rs/releases/tag/v5.3.2

@Byron Byron merged commit 472ce26 into Byron:main Jan 5, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

open::that_detached fails for Windows folder paths with \\?\ prefix
2 participants