xonsh-autoxsh icon indicating copy to clipboard operation
xonsh-autoxsh copied to clipboard

Add a leave dir option

Open diego-rapoport opened this issue 3 years ago • 3 comments

Is it possible to implement auto command when leave dir too? Just asking for this implementation because for several venvs it would be very helpfull.

diego-rapoport avatar Jul 06 '21 02:07 diego-rapoport

@diego-rapoport I've implemented this here: https://github.com/dyuri/xonsh-autoxsh/tree/leave If this is what you wanted I can create a PR, but I think without some kind of parent/children scan this might not be as useful as it seems. For example if you enter a directory, a virtualenv is activated, then you step into a subdirectory of the previous one, and the virtualenv gets deactivated since you left the original directory. But it can print bye pretty well :)

dyuri avatar Jul 10 '21 16:07 dyuri

@diego-rapoport I've implemented this here: https://github.com/dyuri/xonsh-autoxsh/tree/leave If this is what you wanted I can create a PR, but I think without some kind of parent/children scan this might not be as useful as it seems. For example if you enter a directory, a virtualenv is activated, then you step into a subdirectory of the previous one, and the virtualenv gets deactivated since you left the original directory. But it can print bye pretty well :)

Thanks for the implementation!! I think that subdirectories could really be a problem, specially if there's a lot of folders inside the project. Solving this you should definately make a PR

diego-rapoport avatar Jul 11 '21 14:07 diego-rapoport

@diego-rapoport I've implemented the parent checking on my branch (can be enabled via $AXSH_CHECK_PARENTS environment variable), please give it a try if you have some time.

dyuri avatar Jul 17 '21 16:07 dyuri