Add support for UNC paths on Windows#493
Conversation
stevearc
left a comment
There was a problem hiding this comment.
Thanks for the PR! Because this is something I'm not familiar with (windows, and UNC paths in particular) and it's something I can't even test, I'd like to be more rigorous with this area of the code. Could you:
- Check if you need to add anything to the
os_to_posix_pathmethod? - Write up a test plan that covers how you've tested to verify that this works as intended, covering things like
- creating or deleting files via UNC path
- moving files from a UNC path to another UNC path
- moving files from a UNC path to a normal drive path
- moving files from a normal drive path to a UNC path
- Add some automated tests
|
I'm not the author of the original PR, but I've encountered this issue too and have found another / similar way to solve it.
Like if you pass Please suggest some other tests that would make sense here. My fix looks a little bit different, and handles another bug when navigating to the top of the tree. tested manually: YES creating or deleting files via UNC path "YES" means it works with my fix and crashes without the fix. other bugs found: when navigating up (the - binding), there is an error saying for example: Then navigating up one more time, takes me to the list of all local and mapped drives. other notes: this appears to be a result of using telescope find_files. I think it (or rg) returns the paths as original error message: In this case the stuff in Ok, hopefully that is enough context, please advice on how I can proceed with the tests. It would be cool to have this bug fixed in the next version because it breaks my activities on a daily basis :) I can start a new PR if we don't hear from the original author within a week or two. |
|
@tox2ik We don't currently have any tests for the utilities in
We'll need to figure out what's going on here. There is some special windows handling for when you go up past the current drive: oil.nvim/lua/oil/adapters/files.lua Lines 344 to 346 in 42333bb We may need to add some more special handling for these cases as well.
What is causing this error? Are you opening oil from telescope, or opening telescope inside of oil? Since there hasn't been any movement on this PR, feel free to open a new one and continue the conversation there. |
I've added some automated tests in the fs_spec.lua file. I've also manually tested the below scenarios on windows, and all are working fine:
I have also seen issues when navigating to the root UNC path, as mentioned by tox2ik, but haven't looked into any solution for that. I added some tests for the "os_to_posix_path" method. I didn't need to make any changes to that for UNC support. |
stevearc
left a comment
There was a problem hiding this comment.
Fantastic, thanks for testing the behavior! It sounds like there are two issues remaining:
- When navigating to the root of the share, it produces an error
Unknown error: \10.3.0.33\. I'm not entirely sure what's wrong because I don't know where this failure happens. - When you navigate up again, it shows all local and mapped drives. Open question: should it also show these network share paths?
|
Hello, are there any updates on this pull request? This PR seems to address issues with Windows path handling. I've recently encountered a related issue with forward-slash paths on Windows, which I've documented in issue #676: #676. It would be great to see a comprehensive solution for Windows path handling in oil.nvim. |
Resolves #404