Skip to content

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

@unikitty37

Description

@unikitty37

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…)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions