-
Notifications
You must be signed in to change notification settings - Fork 130
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
Add support for UNC paths on Windows #493
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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_path
method? - 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
Resolves #404