Support UNC Paths on windows
Currently zoxide outputs an when navigating to UNC paths like SMB shares \\NAS\Share or WSL files \\wsl$\fedoraremix:
zoxide: invalid path: UNC(
"wsl$",
"fedoraremix",
) \\wsl$\fedoraremix
The problem here seems to be that \\NAS\Share resolves to \\?\UNC\NAS\Share, which PowerShell refuses to cd into. The UNC path is technically valid - for example, Python would have no problem with running os.chdir(r"\\?\UNC\NAS\Share").
I think the best solution here would be writing a custom path resolver for Windows that treats \\?\UNC\ as equivalent to \\, and converts it accordingly.
This should be resolved in the dunce crate, I've filed an issue here: https://gitlab.com/kornelski/dunce/-/issues/2
Just run into this issue trying to access WSL via Nushell. Works fine using PowerShell. It's been over a year since this issue and the other one over at dunce has been updated.
Nushell has an open issue regarding UNC paths and dunce: https://github.com/nushell/nushell/issues/4863#issuecomment-1071037345. Looks like they are related issues.
Hm, looks like we need to move away from dunce if development has stalled. I'll look into this once I have the time.
Dunce author just closed the issue with no fix. Guessing it has indeed stalled.
The omnipath crate provides a fix for this problem: https://github.com/ChrisDenton/omnipath
See this related pull request: https://github.com/nushell/nushell/pull/6824