ajeetdsouza / zoxide

A smarter cd command. Supports all major shells.
MIT License
22.84k stars 556 forks source link

Case insensitivity #114

Open christianbundy opened 4 years ago

christianbundy commented 4 years ago

Hi. My filesystem is case-insensitive but case-preserving, and I've noticed that I have both foo and Foo in my zoxide database. Is there some way to tell zoxide that these are the same directory and should be counted together? Thanks!

ajeetdsouza commented 4 years ago

Hey Christian, what filesystem are you using?

This sounds like a problem that could be fixed with a simple environment variable that converts all paths to lowercase/uppercase, but I'm not sure how Unicode characters would be treated in that case.

christianbundy commented 4 years ago

Hey! I'm using 'APFS (Encrypted)', more info here: https://support.apple.com/guide/disk-utility/file-system-formats-available-in-disk-utility-dsku19ed921c/mac

Happy to be a test subject, if you have any ideas. Thanks for your work on this project!

ajeetdsouza commented 4 years ago

Thanks! Could you try adding foo and Foo using export _ZO_RESOLVE_SYMLINKS=1 and tell me your findings?

christianbundy commented 4 years ago

That works! The database now keeps only the correct name. The only problem I've been able to create (which is convoluted):

mkdir DIRECTORY
cd DIRECTORY
cd -
rm -rf DIRECTORY
mkdir directory
cd directory

Now my database has both ~/directory and ~/DIRECTORY, which isn't possible on my filesystem. Small potatoes, but maybe something someone can fix if they're bored and feel like throwing time at it. 🤷