Skip to content
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

Normalize drive letters when resolving paths on Windows #609

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mataha
Copy link
Contributor

@mataha mataha commented Aug 16, 2023

When it comes to resolving paths on Windows, even though the underlying API expects drive letter prefixes to be uppercase, some sources (e.g. environment variables like =C:) won't normalize components, instead returning the value as-is. While this wouldn't be a problem normally as NTFS is case-insensitive on Windows, this introduces duplicates in the database when adding new entries via zoxide add:

> zoxide query --list
D:\
d:\
D:\coding
d:\coding
D:\coding\.cloned
d:\coding\.cloned

This is a cherry-pick from #567; see also rust-lang/rust-analyzer#14683.

@ajeetdsouza ajeetdsouza force-pushed the main branch 3 times, most recently from 4a7505d to 073500c Compare October 10, 2023 08:58
@mataha mataha force-pushed the fix/drive-letter-normalization branch from 7f7462d to 7d35206 Compare December 15, 2023 23:36
@ajeetdsouza ajeetdsouza force-pushed the main branch 2 times, most recently from d72d9ce to cbb8e77 Compare February 12, 2024 22:37
@mataha mataha force-pushed the fix/drive-letter-normalization branch 4 times, most recently from 34f1b22 to 8a19d52 Compare June 11, 2024 16:21
When it comes to resolving paths on Windows, even though the underlying
API expects drive letter prefixes to be uppercase, some sources (e.g.
environment variables like `=C:`) won't normalize components, instead
returning the value as-is. While this wouldn't be a problem normally as
NTFS is case-insensitive on Windows, this introduces duplicates in the
database when adding new entries via `zoxide add`:

```batchfile prompt
> zoxide query --list
D:\
d:\
D:\coding
d:\coding
D:\coding\.cloned
d:\coding\.cloned
```

This is a cherry-pick from ajeetdsouza#567; see also rust-lang/rust-analyzer#14683.

Signed-off-by: mataha <[email protected]>
@mataha mataha force-pushed the fix/drive-letter-normalization branch from 8a19d52 to ee5ba87 Compare June 15, 2024 12:07
mataha added a commit to mataha/zoxide that referenced this pull request Jun 15, 2024
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.

1 participant