z icon indicating copy to clipboard operation
z copied to clipboard

Go directly to exact match instead of subdirectory

Open madprops opened this issue 4 years ago • 5 comments

I find the following to not work as I would expect:

z pics1 /home/user/Downloads/pics/pics1

z Downloads /home/user/Downloads/pics/pics1

In the second command I intended to go to the Downloads directory. I personally think it should have gone to Downloads since it's specifically using that name directly, instead of going to a subdirectory.

madprops avatar Feb 26 '21 14:02 madprops

Yes, that would be helpful

ghost avatar Mar 25 '21 11:03 ghost

🔥 Very useful improvement on directory matching logic. I have the same problem and it's better a flag indicates if users need to match the exact directory if matched in the ranked list.

masoudgs avatar Mar 30 '21 09:03 masoudgs

I guess I have the same issue:

/git/tepe $ cd ../tep /git/tep $ cd ../tepe /git/tepe $ z tep /git/tepe $

Isn't this the whole point of the program?

delanym avatar Apr 13 '21 06:04 delanym

The Readme even says the following, which I would assume means that it should match the shortest /home/user/Downloads/ in your example.

   Common:
       When multiple directories match all queries, and they all have a common
       prefix, z will cd to the shortest matching directory, without regard to
       priority.  This has been in effect, if  undocumented,  for  quite  some
       time, but should probably be configurable or reconsidered.

Gevrai avatar Apr 29 '21 16:04 Gevrai

I'm working on a separate z implementation that fixes this issue https://github.com/madprops/ezkl

madprops avatar Jul 26 '21 20:07 madprops