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

Trying to autostash function definitions produces odd output on changing directory #65

Open
unikitty37 opened this issue Jul 29, 2020 · 0 comments

Comments

@unikitty37
Copy link

Attempting to autostash a function in an enter script results in the function being run for every other entry in the file. With the following enter script:

autostash npm() { echo "This is the backend"; echo "npm $@" }
autostash alias rails='docker-compose exec backend rails'
autostash alias rake='docker-compose exec backend rake'

this is output on changing into the directory:

This is the backend
npm smartcd_ondescend_callbacks
This is the backend
npm alias rails=docker-compose exec backend rails
This is the backend
npm alias rake=docker-compose exec backend rake

Placing the npm() function at the end of the file makes no difference to the output.

I don't want to use an alias here as it will output all the parameters passed to npm after the error message, which isn't a great look.

Does autostash work with functions? I ended up defining the function without using autostash in the enter script, and using disable -f npm in the leave script, but it would be really useful to be able to use autostash here…

(I'm using zsh, BTW…)

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

No branches or pull requests

1 participant