Skip to content

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

Merged
Byron merged 1 commit into
Byron: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 into
Byron:mainfrom
amrbashir:fix/windows/remove-unc-and-fallback-on-error

Conversation

@amrbashir

@amrbashir amrbashir commented Jan 5, 2025

Copy link
Copy Markdown
Contributor

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

@Byron Byron left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

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