justinmayer / virtualfish

Fish shell tool for managing Python virtual environments
MIT License
1.06k stars 100 forks source link

Events not fired on new tab #123

Closed ghost closed 5 years ago

ghost commented 7 years ago

It seems that events are not fired when you are inside a folder connected with a virtualenv (vf connect) and you open a new tab (by default on Mac OS it opens with the current path).

As you can see on the demo below, the virtualenv gets activated, but the postactivate function that's linked to virtualenv_did_activate event does not execute.

This is my config.fish

eval (python3 -m virtualfish auto_activation)
function postactivate --on-event virtualenv_did_activate
    set -gx HELLO "Hello World!"
end

And here is a little demo: https://streamable.com/ez6nh

Thanks.

daisylb commented 7 years ago

That's strange; I've just tested this and it works fine for me.

What OS version, version of fish (echo $FISH_VERSION) and virtualfish (echo $VIRTUALFISH_VERSION) are you using? (For comparison, mine is macOS 10.12.6, Fish 2.6.0, virtualfish 1.0.5.)

ghost commented 7 years ago

Hi. Thanks for the support. It's still happening, as you can see in this new recording: https://streamable.com/zdpi8

macOS 10.12.6 Fish 2.6.0 Virtualfish 1.0.5

Maybe something wrong with the auto-activation plugin? Thanks.

daisylb commented 7 years ago

What happens if you move the event handler above the eval line?

ghost commented 7 years ago

Yep, that fixed it 🎉

daisylb commented 7 years ago

Awesome!

I'll leave this ticket open for now, because we probably need to document this behaviour.