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

add support for argument to x, to enable removing (not-current) directory #207

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

Conversation

ahamid
Copy link

@ahamid ahamid commented Jul 24, 2017

Workaround for #159

Does not work (PROMPT_COMMAND always adds $PWD again):
[user@there]$ z -x

Does work:
[user@here]$ z -x there

@ericbn
Copy link
Contributor

ericbn commented Oct 16, 2017

As I understand (see #208 (comment)), the -x is already intended to be used with a regexp

$ z -x foo

meaning remove the current directory from the datafile, AND change to the directory matching foo. This is useful right after z foo when that is changing to a directory you don't want to go anymore.

See b9afd5f

@ahamid
Copy link
Author

ahamid commented May 22, 2018

I have encountered this situation again, and z -x <previous-criteria> still does nothing for me

$ z -x foo

In fact, after running this many times ("until you land at target"), looks like it just keeps increasing the bad (current) directory's score. :(

[/base/foo/nested/wrong-foo]$ z -x foo
68         /base/foo
100        /base/foo/nested/wrong-foo
[/base/foo/nested/wrong-foo]$ z -x foo
68         /base/foo
104        /base/foo/nested/wrong-foo
[/base/foo/nested/wrong-foo]$ z -x foo
68         /base/foo
108        /base/foo/nested/wrong-foo
...

@tcely
Copy link

tcely commented Jun 9, 2018

My work-around for this issue has been to cd to the directory I want gone, then use (_z -x; cd -) so that I'm no longer in the removed directory when my prompt command is run the next time.

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.

3 participants