-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Fix the colors when completing using a relative path #12898
Conversation
My version of |
I might've worded the pull request poorly and picked the wrong command to showcase the issue with. The issue is able to be reproduced by typing in any command (not just ls) and then hitting tab in order to select a file with the autocompletion menu. |
I'm unsure if relative paths are supposed to work in the metadata (and symlink_metadata by proxy) function or if the current behaviour is intended and Nushell is not using the function correctly. Anyhow, you can verify for yourself that relative paths are not supported by running the following code.
|
I think for the resolution of relative paths our utmost expert is @YizhePKU who may be able to help you there and can review this PR. |
I think there's some confusion of terminology. In fact, it's not just tilde -- ndots components don't work either (e.g. Instead of trying to resolve paths yourself, you should use |
Thanks |
Description
Fixes a bug where the autocompletion menu has the wrong colors due to 'std::fs::symlink_metadata' not being able to handle relative paths. Attached below are screenshots before and after applying the commit, in which the colors are wrong when autocompleting on a path prefixed by a tilde, whereas the same directory is highlighted correctly when prefixed by a dot.
BEFORE:
AFTER: