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

unexpected chpwd() calls from cd inside the command #32

Closed
s3i7h opened this issue Jan 31, 2015 · 2 comments · Fixed by #33
Closed

unexpected chpwd() calls from cd inside the command #32

s3i7h opened this issue Jan 31, 2015 · 2 comments · Fixed by #33

Comments

@s3i7h
Copy link

s3i7h commented Jan 31, 2015

The new update is awesome! Thanks to all the contributors.

Everything is working fine, but when it lists directories, it shows what's inside too.
It's not that pretty, but it's working, so that is not that big of a deal.
But the concerning part is that it's occuring because I'm setting my own chpwd() to show the directory contents when moving into a directory. This means that the command will call chpwd() even when we didn't change working directory.

When we use this command, we are listing the directory contents, but not actually changing directories.
So changing directory inside a command, even if going back to the original directory, might cause unexpected things to happen.

I don't quite know how we can work it around though.
Are there any possible solutions for this?

@supercrabtree
Copy link
Owner

I didn't write this feature, so I am not sure of a workaround, perhaps @zirrostig can shed some light?

@zirrostig
Copy link
Contributor

I entirely forgot about the zsh builtin hooks, A quick solution is to use cd -q in the code so those won't get called, its not the prettiest solution, but it should fix it for now.

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 a pull request may close this issue.

3 participants