Skip to content

Comments

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

Merged
Byron merged 1 commit intoByron:mainfrom
amrbashir:fix/windows/remove-unc-and-fallback-on-error
Jan 5, 2025
Merged

fix(windows): fix that_detached for UNC path of a directory#107
Byron merged 1 commit intoByron:mainfrom
amrbashir:fix/windows/remove-unc-and-fallback-on-error

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