oh-my-fish / plugin-direnv

Unclutter your .profile http://direnv.net
MIT License
14 stars 9 forks source link

Direnv doesn't activate automatically on a new tab/split #2

Open Bastes opened 7 years ago

Bastes commented 7 years ago

Hey ^^

I've updated Oh My Fish! along with this here direnv plugin recently and noted that now direnv doesn't activate automatically when I produce a new split or tab in the same directory.

It activates as soon as I'm doing a $ cd ., so there's no question oh-my-fish and plugin-direnv are working, it's just frustrating to have to do it every time I open a new split or tab.

I'm on Ubuntu 16.04 ; direnv v2.7.0 ; the latest Oh My Fish and direnv plugin.

I'll see if I can find some way to contribute beyond reporting the issue, although I don't quite know where to start beyond trying to make sense of the history of the plugin or Oh My Fish!, so guidance would be appreciated ^^°

Bastes commented 7 years ago

Aha, found that when I reverted the commit https://github.com/oh-my-fish/plugin-direnv/commit/c86058d8cca8fd953fe0249d08f300e9f4916e31 direnv activated again like it used to on new tabs / splits.

My guess here (I'm a noob at fish scripting ^^°) is that the function __direnv_export_eval --on-variable PWD call makes it only activate on pwd changes, that don't happen since the new split/tab is created on right directory.

How could we go about reacting to a new split/tab type even is beyond me though ^^° any ideas?

Bastes commented 7 years ago

One "Close issue" misclick and a bit of googling later, I'm holding on to a big nothing on how to trigger something on startup, except simply calling the command right in the init file, just like it was before https://github.com/oh-my-fish/plugin-direnv/commit/c86058d8cca8fd953fe0249d08f300e9f4916e31 ; so I've tried that approach, which seems to work, and I'm sending a pull request for your consideration ^^

kdiogenes commented 7 years ago

@Bastes I think that your guess is correct. I'm not using rvm anymore, nor have it installed, so I will not test it any soon...

Bastes commented 7 years ago

@cerdiogenes Well, that sounds a bit like a deadlock ^^° what can I do to solve the conendrum?

kdiogenes commented 7 years ago

@Bastes I don't have much knowledge about developing fish/oh-my-fish plugins. Maybe a maintainer, I hear about @derekstavis :-), could give you any hint in how to make direnv also execute on creation.

And it's not a deadlock, my last comment says that I released the lock :laughing:

Bastes commented 7 years ago

@cerdiogenes Thanks for your help ^^ I hope @derekstavis can give me a clue about how to fix it appropriately for everyone.

What I meant by "deadlock" was that I didn't want to un-fix your fix, because even though you're not using it at the moment, I'd rather those potential others that would be benefiting from it didn't get a regression either.

Bastes commented 7 years ago

Hey there, anyone listening (if any) with maybe the ability to accept the pull request on this repo... how about we accept this one since nobody seems to have an objection? :)

glukki commented 6 years ago

I surrendered, and just added cd ./ to the end of my config.fish >_>